From e7b7d37a4e8f945ff35f0317eb64485dd0d94287 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 17 Mar 2021 13:38:08 +0100 Subject: [PATCH] Updated chain module exchange types --- chain/client/contract_discover.go | 75 - chain/exchange/types/codec.go | 36 +- chain/exchange/types/coin.go | 38 + chain/exchange/types/errors.go | 29 +- chain/exchange/types/events.go | 2 +- chain/exchange/types/exchange.go | 303 + chain/exchange/types/exchange.pb.go | 6131 +++++++------ chain/exchange/types/genesis.go | 14 - chain/exchange/types/genesis.pb.go | 456 - chain/exchange/types/key.go | 127 - chain/exchange/types/module.go | 5 + chain/exchange/types/msgs.go | 589 +- chain/exchange/types/msgs.pb.go | 3136 ------- chain/exchange/types/orderbook.go | 34 + chain/exchange/types/orders.go | 339 +- chain/exchange/types/params.go | 207 +- chain/exchange/types/params.pb.go | 496 -- chain/exchange/types/paramset.go | 26 - chain/exchange/types/proposal.go | 393 +- chain/exchange/types/proposal.pb.go | 458 - chain/exchange/types/querier.go | 9 - chain/exchange/types/query.pb.go | 11834 ++++---------------------- chain/exchange/types/query.pb.gw.go | 1570 ---- chain/exchange/types/spot_orders.go | 114 - chain/exchange/types/subaccount.go | 24 + chain/exchange/types/tx.pb.go | 7872 +++++++++++++++++ chain/exchange/types/types.go | 305 - 27 files changed, 13616 insertions(+), 21006 deletions(-) delete mode 100644 chain/client/contract_discover.go create mode 100644 chain/exchange/types/coin.go create mode 100644 chain/exchange/types/exchange.go delete mode 100644 chain/exchange/types/genesis.go delete mode 100644 chain/exchange/types/genesis.pb.go delete mode 100644 chain/exchange/types/key.go create mode 100644 chain/exchange/types/module.go delete mode 100644 chain/exchange/types/msgs.pb.go create mode 100644 chain/exchange/types/orderbook.go delete mode 100644 chain/exchange/types/params.pb.go delete mode 100644 chain/exchange/types/paramset.go delete mode 100644 chain/exchange/types/proposal.pb.go delete mode 100644 chain/exchange/types/querier.go delete mode 100644 chain/exchange/types/query.pb.gw.go delete mode 100644 chain/exchange/types/spot_orders.go create mode 100644 chain/exchange/types/subaccount.go create mode 100644 chain/exchange/types/tx.pb.go delete mode 100644 chain/exchange/types/types.go diff --git a/chain/client/contract_discover.go b/chain/client/contract_discover.go deleted file mode 100644 index 2b0d3474..00000000 --- a/chain/client/contract_discover.go +++ /dev/null @@ -1,75 +0,0 @@ -package client - -import ( - "context" - "time" - - "github.com/ethereum/go-ethereum/common" - log "github.com/xlab/suplog" - - exchangetypes "github.com/InjectiveLabs/sdk-go/chain/exchange/types" -) - -type ContractSet struct { - FuturesContract common.Address - PriceFeederContract common.Address -} - -type ContractDiscoverer interface { - GetContractSet(ctx context.Context) ContractSet -} - -func NewContractDiscoverer(ordersQuerier exchangetypes.QueryClient) ContractDiscoverer { - return &contractDiscoverer{ - queryClient: ordersQuerier, - logger: log.WithFields(log.Fields{ - "module": "sdk-go", - "svc": "contractDiscoverer", - }), - } -} - -type contractDiscoverer struct { - queryClient exchangetypes.QueryClient - logger log.Logger -} - -const defaultRetryDelay = 10 * time.Second - -func (c *contractDiscoverer) GetContractSet(ctx context.Context) (set ContractSet) { - for { - select { - case <-ctx.Done(): - return - default: - 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) - continue - } else if resp == nil || len(resp.Markets) == 0 { - c.logger.Warningln("no derivative markets returned, retry in 10s") - time.Sleep(defaultRetryDelay) - continue - } - - for _, market := range resp.Markets { - set.FuturesContract = common.HexToAddress(market.ExchangeAddress) - set.PriceFeederContract = common.HexToAddress(market.Oracle) - if set.FuturesContract != (common.Address{}) && - set.PriceFeederContract != (common.Address{}) { - return - } - } - - if set.FuturesContract == (common.Address{}) || - set.PriceFeederContract == (common.Address{}) { - c.logger.WithFields(log.Fields{ - "futures_contract": set.FuturesContract.Hex(), - "price_feeder_contract": set.PriceFeederContract.Hex(), - }).Warningln("could not discover some market contracts, retry in 10s") - continue - } - } - } -} diff --git a/chain/exchange/types/codec.go b/chain/exchange/types/codec.go index 9f41640f..12ee3bb0 100644 --- a/chain/exchange/types/codec.go +++ b/chain/exchange/types/codec.go @@ -4,6 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -16,26 +17,33 @@ var ( ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) ) -// RegisterCodec registers concrete types on the Amino codec +// RegisterInterfaces registers concrete types on the Amino codec func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), - &MsgInitExchange{}, - &MsgRegisterDerivativeMarket{}, - &MsgSuspendDerivativeMarket{}, - &MsgResumeDerivativeMarket{}, - &MsgCreateDerivativeOrder{}, - &MsgSoftCancelDerivativeOrder{}, - &MsgRegisterSpotMarket{}, - &MsgSuspendSpotMarket{}, - &MsgResumeSpotMarket{}, - &MsgCreateSpotOrder{}, - &MsgExecuteDerivativeTakeOrder{}, - &MsgExecuteTECTransaction{}, + &MsgDeposit{}, + &MsgWithdraw{}, + &MsgInstantSpotMarketLaunch{}, + &MsgCreateSpotLimitOrder{}, + &MsgCreateSpotMarketOrder{}, + &MsgCancelSpotOrder{}, + &MsgCreateDerivativeLimitOrder{}, + &MsgCreateDerivativeMarketOrder{}, + &MsgCancelDerivativeOrder{}, + &MsgSubaccountTransfer{}, + &MsgExternalTransfer{}, ) registry.RegisterImplementations( (*govtypes.Content)(nil), - &RegisterExchangeProposal{}, + &SpotMarketParamUpdateProposal{}, + &SpotMarketLaunchProposal{}, + &SpotMarketStatusSetProposal{}, + &PerpetualMarketLaunchProposal{}, + &ExpiryFuturesMarketLaunchProposal{}, + &DerivativeMarketParamUpdateProposal{}, + &DerivativeMarketStatusSetProposal{}, ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/chain/exchange/types/coin.go b/chain/exchange/types/coin.go new file mode 100644 index 00000000..9e4a7784 --- /dev/null +++ b/chain/exchange/types/coin.go @@ -0,0 +1,38 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + // INJ defines the default coin denomination used in Ethermint in: + // + // - Staking parameters: denomination used as stake in the dPoS chain + // - Mint parameters: denomination minted due to fee distribution rewards + // - Governance parameters: denomination used for spam prevention in proposal deposits + // - Crisis parameters: constant fee denomination used for spam prevention to check broken invariant + // - EVM parameters: denomination used for running EVM state transitions in Ethermint. + InjectiveCoin string = "inj" + + // BaseDenomUnit defines the base denomination unit for Photons. + // 1 photon = 1x10^{BaseDenomUnit} inj + BaseDenomUnit = 18 +) + +// NewInjectiveCoin is a utility function that returns an "inj" coin with the given sdk.Int amount. +// The function will panic if the provided amount is negative. +func NewInjectiveCoin(amount sdk.Int) sdk.Coin { + return sdk.NewCoin(InjectiveCoin, amount) +} + +// NewInjectiveDecCoin is a utility function that returns an "inj" decimal coin with the given sdk.Int amount. +// The function will panic if the provided amount is negative. +func NewInjectiveDecCoin(amount sdk.Int) sdk.DecCoin { + return sdk.NewDecCoin(InjectiveCoin, amount) +} + +// NewInjectiveCoinInt64 is a utility function that returns an "inj" coin with the given int64 amount. +// The function will panic if the provided amount is negative. +func NewInjectiveCoinInt64(amount int64) sdk.Coin { + return sdk.NewInt64Coin(InjectiveCoin, amount) +} diff --git a/chain/exchange/types/errors.go b/chain/exchange/types/errors.go index b763a589..84abf26d 100644 --- a/chain/exchange/types/errors.go +++ b/chain/exchange/types/errors.go @@ -7,10 +7,10 @@ import ( var ( ErrOrderInvalid = sdkerrors.Register(ModuleName, 1, "failed to validate order") 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") - ErrSpotMarketExists = sdkerrors.Register(ModuleName, 5, "trade pair exists") - ErrPairMismatch = sdkerrors.Register(ModuleName, 6, "trade pair mismatch") + ErrSpotMarketSuspended = sdkerrors.Register(ModuleName, 3, "spot market suspended") + ErrSpotMarketNotFound = sdkerrors.Register(ModuleName, 4, "spot market not found") + ErrSpotMarketExists = sdkerrors.Register(ModuleName, 5, "spot market exists") + ErrSpotMarketMismatch = sdkerrors.Register(ModuleName, 6, "spot market mismatch") ErrBadField = sdkerrors.Register(ModuleName, 7, "struct field error") ErrMarketNotFound = sdkerrors.Register(ModuleName, 8, "derivative market not found") ErrMarketInvalid = sdkerrors.Register(ModuleName, 9, "failed to validate derivative market") @@ -21,7 +21,7 @@ var ( ErrOverLeveragedOrder = sdkerrors.Register(ModuleName, 14, "cannot add overlevered order") ErrSubaccountNotFound = sdkerrors.Register(ModuleName, 15, "subaccount not found") ErrOrderAlreadyExists = sdkerrors.Register(ModuleName, 16, "order already exists") - ErrInsufficientMargin = sdkerrors.Register(ModuleName, 17, "subaccount has insufficient margin") + ErrInsufficientDeposit = sdkerrors.Register(ModuleName, 17, "subaccount has insufficient margin") ErrMarketExpired = sdkerrors.Register(ModuleName, 18, "market has already expired") ErrOrderExpired = sdkerrors.Register(ModuleName, 19, "order has already expired") ErrInsufficientOrderQuantity = sdkerrors.Register(ModuleName, 20, "order quantity invalid") @@ -34,6 +34,21 @@ var ( ErrReplayTecTransaction = sdkerrors.Register(ModuleName, 27, "cannot replay TEC transaction") ErrOrderAlreadyArchived = sdkerrors.Register(ModuleName, 28, "order already in archive store") ErrAddressNotContract = sdkerrors.Register(ModuleName, 29, "address is not a smart contract") - ErrExchangeAlreadySet = sdkerrors.Register(ModuleName, 30, "Exchange address already set") - ErrBadExchangeAddress = sdkerrors.Register(ModuleName, 31, "Bad exchange address") + ErrOrderIDInvalid = sdkerrors.Register(ModuleName, 30, "order id is not valid") + ErrBadSubaccountID = sdkerrors.Register(ModuleName, 31, "subaccount id is not valid") + ErrInvalidTicker = sdkerrors.Register(ModuleName, 32, "invalid ticker") + ErrInvalidBaseDenom = sdkerrors.Register(ModuleName, 33, "invalid base denom") + ErrInvalidQuoteDenom = sdkerrors.Register(ModuleName, 34, "invalid quote denom") + ErrOrderDoesntExist = sdkerrors.Register(ModuleName, 35, "order doesnt exist") + + ErrDepositDoesntExist = sdkerrors.Register(ModuleName, 37, "deposit doesnt exist") + ErrOrderbookDoesntExist = sdkerrors.Register(ModuleName, 38, "spot limit orderbook doesnt exist") + ErrOrderbookFillInvalid = sdkerrors.Register(ModuleName, 39, "spot limit orderbook fill invalid") + ErrPerpetualMarketExists = sdkerrors.Register(ModuleName, 40, "perpetual market exists") + ErrExpiryFuturesMarketExists = sdkerrors.Register(ModuleName, 41, "expiry futures market exists") + ErrExpiryFuturesMarketExpired = sdkerrors.Register(ModuleName, 42, "expiry futures market expired") + ErrNoLiquidity = sdkerrors.Register(ModuleName, 43, "no liquidity on the orderbook!") + ErrSlippageExceedsWorstPrice = sdkerrors.Register(ModuleName, 44, "Orderbook liquidity cannot satisfy current worst price") + ErrInsufficientOrderMargin = sdkerrors.Register(ModuleName, 45, "Order has insufficient margin") + ErrDerivativeMarketNotFound = sdkerrors.Register(ModuleName, 46, "Derivative market not found") ) diff --git a/chain/exchange/types/events.go b/chain/exchange/types/events.go index de8b5a1c..47f37767 100644 --- a/chain/exchange/types/events.go +++ b/chain/exchange/types/events.go @@ -17,7 +17,7 @@ const ( AttributeKeyTradePairHash = "trade_pair_hash" AttributeKeySignedOrder = "signed_order" AttributeKeyFilledAmount = "filled_amount" - AttributeKeyUnfilledAmount = "unfilled_amount" + AttributeKeyFillableAmount = "fillable_amount" AttributeKeyWasActiveOrder = "was_active_order" AttributeKeyPrice = "price" AttributeKeyTicker = "ticker" diff --git a/chain/exchange/types/exchange.go b/chain/exchange/types/exchange.go new file mode 100644 index 00000000..ca5d24cc --- /dev/null +++ b/chain/exchange/types/exchange.go @@ -0,0 +1,303 @@ +package types + +import ( + "fmt" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "golang.org/x/crypto/sha3" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + ethmath "github.com/ethereum/go-ethereum/common/math" + gethsigner "github.com/ethereum/go-ethereum/signer/core" +) + +var eip712OrderTypes = gethsigner.Types{ + "EIP712Domain": { + {Name: "name", Type: "string"}, + {Name: "version", Type: "string"}, + {Name: "chainId", Type: "uint256"}, + {Name: "verifyingContract", Type: "address"}, + {Name: "salt", Type: "bytes32"}, + }, + "OrderInfo": { + {Name: "SubaccountId", Type: "string"}, + {Name: "FeeRecipient", Type: "string"}, + {Name: "Price", Type: "string"}, + {Name: "Quantity", Type: "string"}, + }, + "SpotOrder": { + {Name: "MarketId", Type: "string"}, + {Name: "OrderInfo", Type: "OrderInfo"}, + {Name: "Salt", Type: "string"}, + {Name: "OrderType", Type: "string"}, + {Name: "TriggerPrice", Type: "string"}, + }, + "DerivativeOrder": { + {Name: "MarketId", Type: "string"}, + {Name: "OrderInfo", Type: "OrderInfo"}, + {Name: "OrderType", Type: "string"}, + {Name: "Margin", Type: "string"}, + {Name: "TriggerPrice", Type: "string"}, + {Name: "Salt", Type: "string"}, + }, +} + +// ComputeOrderHash computes the order hash for given derivative limit order +func (o *DerivativeOrder) ComputeOrderHash() (common.Hash, error) { + chainID := ethmath.NewHexOrDecimal256(888) + var domain = gethsigner.TypedDataDomain{ + Name: "Injective Protocol", + Version: "2.0.0", + ChainId: chainID, + VerifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", + Salt: "0x0000000000000000000000000000000000000000000000000000000000000000", + } + + var message = map[string]interface{}{ + "MarketId": o.MarketId, + "OrderInfo": map[string]interface{}{ + "SubaccountId": o.OrderInfo.SubaccountId, + "FeeRecipient": o.OrderInfo.FeeRecipient, + "Price": o.OrderInfo.Price.String(), + "Quantity": o.OrderInfo.Quantity.String(), + }, + "Margin": o.Margin.String(), + "OrderType": string(o.OrderType), + "TriggerPrice": o.TriggerPrice.String(), + "Salt": fmt.Sprint(o.Salt), + } + + var typedData = gethsigner.TypedData{ + Types: eip712OrderTypes, + PrimaryType: "DerivativeOrder", + Domain: domain, + Message: message, + } + + domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map()) + if err != nil { + return ZeroHash, err + } + typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message) + if err != nil { + return ZeroHash, err + } + + w := sha3.NewLegacyKeccak256() + w.Write([]byte("\x19\x01")) + w.Write([]byte(domainSeparator)) + w.Write([]byte(typedDataHash)) + + hash := common.BytesToHash(w.Sum(nil)) + return hash, nil +} + +// ComputeOrderHash computes the order hash for given spot limit order +func (o *SpotOrder) ComputeOrderHash() (common.Hash, error) { + chainID := ethmath.NewHexOrDecimal256(888) + var domain = gethsigner.TypedDataDomain{ + Name: "Injective Protocol", + Version: "2.0.0", + ChainId: chainID, + VerifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", + Salt: "0x0000000000000000000000000000000000000000000000000000000000000000", + } + + var message = map[string]interface{}{ + "MarketId": o.MarketId, + "OrderInfo": map[string]interface{}{ + "SubaccountId": o.OrderInfo.SubaccountId, + "FeeRecipient": o.OrderInfo.FeeRecipient, + "Price": o.OrderInfo.Price.String(), + "Quantity": o.OrderInfo.Quantity.String(), + }, + "Salt": fmt.Sprint(o.Salt), + "OrderType": string(o.OrderType), + "TriggerPrice": o.TriggerPrice.String(), + } + + var typedData = gethsigner.TypedData{ + Types: eip712OrderTypes, + PrimaryType: "SpotOrder", + Domain: domain, + Message: message, + } + + domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map()) + if err != nil { + return ZeroHash, err + } + typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message) + if err != nil { + return ZeroHash, err + } + + w := sha3.NewLegacyKeccak256() + w.Write([]byte("\x19\x01")) + w.Write([]byte(domainSeparator)) + w.Write([]byte(typedDataHash)) + + hash := common.BytesToHash(w.Sum(nil)) + return hash, nil +} + +type MatchedMarketDirection struct { + MarketId common.Hash + BuysExists bool + SellsExists bool +} + +func (m *SpotOrder) IsBuy() bool { + return m.OrderType.IsBuy() +} + +func (t OrderType) IsBuy() bool { + switch t { + case OrderType_BUY, OrderType_STOP_BUY, OrderType_TAKE_BUY: + return true + case OrderType_SELL, OrderType_STOP_SELL, OrderType_TAKE_SELL: + return false + } + return false +} + +func (m *SpotLimitOrder) IsBuy() bool { + return m.OrderType.IsBuy() +} + +func (m *SpotLimitOrder) GetUnfilledNotional() sdk.Dec { + return m.Fillable.Mul(m.OrderInfo.Price) +} +func (m *SpotLimitOrder) GetUnfilledFeeAmount(fee sdk.Dec) sdk.Dec { + return m.GetUnfilledNotional().Mul(fee) +} + +func (m *OrderInfo) GetNotional() sdk.Dec { + return m.Quantity.Mul(m.Price) +} + +func (m *OrderInfo) GetFeeAmount(fee sdk.Dec) sdk.Dec { + return m.GetNotional().Mul(fee) +} + +func (m *SpotOrder) GetBalanceHoldAndMarginDenom(market *SpotMarket) (sdk.Dec, string) { + var denom string + var balanceHold sdk.Dec + if m.IsBuy() { + // for a limit buy in the ETH/USDT market, denom is USDT and balanceHold is (1 + takerFee)*(price * quantity) + denom = market.QuoteDenom + balanceHold = m.OrderInfo.GetNotional().Add(m.OrderInfo.GetFeeAmount(market.TakerFeeRate)) + } else { + // for a limit sell in the ETH/USDT market, denom is ETH and balanceHold is just quantity + denom = market.BaseDenom + balanceHold = m.OrderInfo.Quantity + } + + return balanceHold, denom +} + +func (m *SpotLimitOrder) GetUnfilledMarginHoldAndMarginDenom(market *SpotMarket) (sdk.Dec, string) { + var denom string + var balanceHold sdk.Dec + if m.IsBuy() { + // for a limit buy in the ETH/USDT market, denom is USDT and fillable amount is BalanceHold is (1 + makerFee)*(price * quantity) + // (takerFee - makerFee) is already refunded + denom = market.QuoteDenom + balanceHold = m.GetUnfilledNotional().Add(m.GetUnfilledFeeAmount(market.MakerFeeRate)) + } else { + // for a limit sell in the ETH/USDT market, denom is ETH and balanceHold is just quantity + denom = market.BaseDenom + balanceHold = m.Fillable + } + + return balanceHold, denom +} + +func (m *SpotOrder) GetMarginDenom(market *SpotMarket) string { + var denom string + if m.IsBuy() { + // for a market buy in the ETH/USDT market, margin denom is USDT + denom = market.QuoteDenom + } else { + // for a market buy in the ETH/USDT market, margin denom is ETH + denom = market.BaseDenom + } + return denom +} + +// Calculate the balance hold for the market order. +// availableBalance should be in the margin denom +func (m *SpotOrder) CheckMarketOrderBalanceHold(market *SpotMarket, availableBalance, bestPrice sdk.Dec) (sdk.Dec, error) { + var balanceHold sdk.Dec + + if m.IsBuy() { + // required margin for best sell price = bestPrice * quantity * (1 + takerFeeRate) + requiredMarginForBestPrice := bestPrice.Mul(m.OrderInfo.Quantity).Mul(sdk.OneDec().Add(market.TakerFeeRate)) + requiredMarginForWorstPrice := m.OrderInfo.Price.Mul(m.OrderInfo.Quantity).Mul(sdk.OneDec().Add(market.TakerFeeRate)) + requiredMargin := sdk.MaxDec(requiredMarginForBestPrice, requiredMarginForWorstPrice) + if requiredMargin.GT(availableBalance) { + return sdk.Dec{}, sdkerrors.Wrapf(ErrInsufficientDeposit, "Required Margin %s exceeds availableBalance %s", requiredMargin.String(), availableBalance.String()) + } + balanceHold = requiredMargin + } else { + // required margin for market sells just equals the quantity being sold + if availableBalance.LT(m.OrderInfo.Quantity) { + return sdk.Dec{}, sdkerrors.Wrapf(ErrInsufficientDeposit, "Required Sell Quantity %s exceeds availableBalance %s", m.OrderInfo.Quantity.String(), availableBalance.String()) + } + balanceHold = m.OrderInfo.Quantity + } + return balanceHold, nil +} + +func (o *DerivativeOrder) CheckMarginAndGetBalanceHold(market *DerivativeMarket) (balanceHold sdk.Dec, err error) { + notional := o.OrderInfo.Price.Mul(o.OrderInfo.Quantity) + feeAmount := notional.Mul(market.TakerFeeRate) + // Margin ≥ InitialMarginRatio * Price * Quantity + if o.Margin.LT(market.InitialMarginRatio.Mul(notional)) { + return sdk.Dec{}, ErrInsufficientOrderMargin + } + + markPriceThreshold := o.ComputeInitialMarginRequirementMarkPriceThreshold(market.InitialMarginRatio) + // For Buys: MarkPrice ≥ (Margin - Price * Quantity) / ((InitialMarginRatio - 1) * Quantity) + // For Sells: MarkPrice ≤ (Margin + Price * Quantity) / ((1+ InitialMarginRatio) * Quantity) + if o.OrderType.IsBuy() && market.MarkPrice.LT(markPriceThreshold) { + return sdk.Dec{}, ErrInsufficientOrderMargin + } else if !o.OrderType.IsBuy() && market.MarkPrice.GT(markPriceThreshold) { + return sdk.Dec{}, ErrInsufficientOrderMargin + } + return o.Margin.Add(feeAmount), nil +} + +func (o *DerivativeOrder) ComputeInitialMarginRequirementMarkPriceThreshold(initialMarginRatio sdk.Dec) sdk.Dec { + notional := o.OrderInfo.Price.Mul(o.OrderInfo.Quantity) + var numerator, denominator sdk.Dec + if o.OrderType.IsBuy() { + numerator = o.Margin.Sub(notional) + denominator = initialMarginRatio.Sub(sdk.OneDec()).Mul(o.OrderInfo.Quantity) + } else { + numerator = o.Margin.Add(notional) + denominator = initialMarginRatio.Add(sdk.OneDec()).Mul(o.OrderInfo.Quantity) + } + return numerator.Quo(denominator) +} + +// TODO do for market order +func (o *DerivativeOrder) CheckMarketOrderMarginHold(market *DerivativeMarket) (balanceHold sdk.Dec, err error) { + //notional := o.OrderInfo.Price.Mul(o.OrderInfo.Quantity) + //feeAmount := notional.Mul(market.TakerFeeRate) + // Margin ≥ InitialMarginRatio * Price * Quantity + //if o.Margin.LT(market.InitialMarginRatio.Mul(notional)) { + // return sdk.Dec{}, ErrInsufficientOrderMargin + //} + + //markPriceThreshold := o.ComputeInitialMarginRequirementMarkPriceThreshold(market.InitialMarginRatio) + // For Buys: MarkPrice ≥ (Margin - Price * Quantity) / ((InitialMarginRatio - 1) * Quantity) + // For Sells: MarkPrice ≤ (Margin + Price * Quantity) / ((1+ InitialMarginRatio) * Quantity) + //if o.OrderType.IsBuy() && market.MarkPrice.LT(markPriceThreshold) { + // return sdk.Dec{}, ErrInsufficientOrderMargin + //} else if !o.OrderType.IsBuy() && market.MarkPrice.GT(markPriceThreshold) { + // return sdk.Dec{}, ErrInsufficientOrderMargin + //} + //return o.Margin.Add(feeAmount), nil + return +} diff --git a/chain/exchange/types/exchange.pb.go b/chain/exchange/types/exchange.pb.go index 2d86d4b0..82562649 100644 --- a/chain/exchange/types/exchange.pb.go +++ b/chain/exchange/types/exchange.pb.go @@ -5,6 +5,8 @@ package types import ( fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -23,118 +25,214 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// order types -type SpotLimitOrder_LimitOrderType int32 +type MarketStatus int32 const ( - SpotLimitOrder_LIMIT SpotLimitOrder_LimitOrderType = 0 - SpotLimitOrder_STOP SpotLimitOrder_LimitOrderType = 1 - SpotLimitOrder_TAKE SpotLimitOrder_LimitOrderType = 2 + MarketStatus_Active MarketStatus = 0 + MarketStatus_Paused MarketStatus = 1 + MarketStatus_Suspended MarketStatus = 2 + MarketStatus_Demolished MarketStatus = 3 ) -var SpotLimitOrder_LimitOrderType_name = map[int32]string{ - 0: "LIMIT", - 1: "STOP", - 2: "TAKE", +var MarketStatus_name = map[int32]string{ + 0: "Active", + 1: "Paused", + 2: "Suspended", + 3: "Demolished", } -var SpotLimitOrder_LimitOrderType_value = map[string]int32{ - "LIMIT": 0, - "STOP": 1, - "TAKE": 2, +var MarketStatus_value = map[string]int32{ + "Active": 0, + "Paused": 1, + "Suspended": 2, + "Demolished": 3, } -func (x SpotLimitOrder_LimitOrderType) String() string { - return proto.EnumName(SpotLimitOrder_LimitOrderType_name, int32(x)) +func (x MarketStatus) String() string { + return proto.EnumName(MarketStatus_name, int32(x)) } -func (SpotLimitOrder_LimitOrderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2116e2804e9c53f9, []int{2, 0} +func (MarketStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{0} +} + +type OrderType int32 + +const ( + OrderType_BUY OrderType = 0 + OrderType_SELL OrderType = 1 + OrderType_STOP_BUY OrderType = 2 + OrderType_STOP_SELL OrderType = 3 + OrderType_TAKE_BUY OrderType = 4 + OrderType_TAKE_SELL OrderType = 5 +) + +var OrderType_name = map[int32]string{ + 0: "BUY", + 1: "SELL", + 2: "STOP_BUY", + 3: "STOP_SELL", + 4: "TAKE_BUY", + 5: "TAKE_SELL", +} + +var OrderType_value = map[string]int32{ + "BUY": 0, + "SELL": 1, + "STOP_BUY": 2, + "STOP_SELL": 3, + "TAKE_BUY": 4, + "TAKE_SELL": 5, +} + +func (x OrderType) String() string { + return proto.EnumName(OrderType_name, int32(x)) +} + +func (OrderType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{1} } -// order types -type SpotMarketOrder_MarketOrderType int32 +type Direction int32 const ( - SpotMarketOrder_MARKET SpotMarketOrder_MarketOrderType = 0 - SpotMarketOrder_STOP SpotMarketOrder_MarketOrderType = 1 - SpotMarketOrder_TAKE SpotMarketOrder_MarketOrderType = 2 + Direction_Long Direction = 0 + Direction_Short Direction = 1 ) -var SpotMarketOrder_MarketOrderType_name = map[int32]string{ - 0: "MARKET", - 1: "STOP", - 2: "TAKE", +var Direction_name = map[int32]string{ + 0: "Long", + 1: "Short", } -var SpotMarketOrder_MarketOrderType_value = map[string]int32{ - "MARKET": 0, - "STOP": 1, - "TAKE": 2, +var Direction_value = map[string]int32{ + "Long": 0, + "Short": 1, } -func (x SpotMarketOrder_MarketOrderType) String() string { - return proto.EnumName(SpotMarketOrder_MarketOrderType_name, int32(x)) +func (x Direction) String() string { + return proto.EnumName(Direction_name, int32(x)) } -func (SpotMarketOrder_MarketOrderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2116e2804e9c53f9, []int{3, 0} +func (Direction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{2} } -// order types -type BaseSpotOrder_OrderType int32 +type ExecutionType 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 + ExecutionType_Market ExecutionType = 0 + ExecutionType_LimitFill ExecutionType = 1 + ExecutionType_LimitMatchRestingOrder ExecutionType = 2 + ExecutionType_LimitMatchNewOrder ExecutionType = 3 ) -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 ExecutionType_name = map[int32]string{ + 0: "Market", + 1: "LimitFill", + 2: "LimitMatchRestingOrder", + 3: "LimitMatchNewOrder", +} + +var ExecutionType_value = map[string]int32{ + "Market": 0, + "LimitFill": 1, + "LimitMatchRestingOrder": 2, + "LimitMatchNewOrder": 3, +} + +func (x ExecutionType) String() string { + return proto.EnumName(ExecutionType_name, int32(x)) +} + +func (ExecutionType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{3} +} + +type Params struct { + // spot_market_instant_listing_fee defines the expedited fee in INJ required to create a spot market by bypassing governance + SpotMarketInstantListingFee types.Coin `protobuf:"bytes,1,opt,name=spot_market_instant_listing_fee,json=spotMarketInstantListingFee,proto3" json:"spot_market_instant_listing_fee"` + // derivative_market_instant_listing_fee defines the expedited fee in INJ required to create a derivative market by bypassing governance + DerivativeMarketInstantListingFee types.Coin `protobuf:"bytes,2,opt,name=derivative_market_instant_listing_fee,json=derivativeMarketInstantListingFee,proto3" json:"derivative_market_instant_listing_fee"` + // default_spot_maker_fee defines the default exchange trade fee for makers on a spot market + DefaultSpotMakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=default_spot_maker_fee_rate,json=defaultSpotMakerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_spot_maker_fee_rate"` + // default_spot_taker_fee_rate defines the default exchange trade fee rate for takers on a new spot market + DefaultSpotTakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=default_spot_taker_fee_rate,json=defaultSpotTakerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_spot_taker_fee_rate"` + // default_derivative_maker_fee defines the default exchange trade fee for makers on a new derivative market + DefaultDerivativeMakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=default_derivative_maker_fee_rate,json=defaultDerivativeMakerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_derivative_maker_fee_rate"` + // default_derivative_taker_fee defines the default exchange trade fee for takers on a new derivative market + DefaultDerivativeTakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=default_derivative_taker_fee_rate,json=defaultDerivativeTakerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_derivative_taker_fee_rate"` + // default_initial_margin_ratio defines the default initial margin ratio on a new derivative market + DefaultInitialMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=default_initial_margin_ratio,json=defaultInitialMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_initial_margin_ratio"` + // default_maintenance_margin_ratio defines the default maintenance margin ratio on a new derivative market + DefaultMaintenanceMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=default_maintenance_margin_ratio,json=defaultMaintenanceMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"default_maintenance_margin_ratio"` + // default_funding_interval defines the default funding interval on a derivative market + DefaultFundingInterval int64 `protobuf:"varint,9,opt,name=default_funding_interval,json=defaultFundingInterval,proto3" json:"default_funding_interval,omitempty"` + // funding_multiple defines the timestamp multiple that the funding timestamp should be a multiple of + FundingMultiple int64 `protobuf:"varint,10,opt,name=funding_multiple,json=fundingMultiple,proto3" json:"funding_multiple,omitempty"` + // relayer_fee_share_rate defines the trade fee share percentage that goes to relayers + RelayerFeeShareRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=relayer_fee_share_rate,json=relayerFeeShareRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"relayer_fee_share_rate"` +} + +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_2116e2804e9c53f9, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetSpotMarketInstantListingFee() types.Coin { + if m != nil { + return m.SpotMarketInstantListingFee + } + return types.Coin{} } -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 (m *Params) GetDerivativeMarketInstantListingFee() types.Coin { + if m != nil { + return m.DerivativeMarketInstantListingFee + } + return types.Coin{} } -func (x BaseSpotOrder_OrderType) String() string { - return proto.EnumName(BaseSpotOrder_OrderType_name, int32(x)) +func (m *Params) GetDefaultFundingInterval() int64 { + if m != nil { + return m.DefaultFundingInterval + } + return 0 } -func (BaseSpotOrder_OrderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2116e2804e9c53f9, []int{4, 0} +func (m *Params) GetFundingMultiple() int64 { + if m != nil { + return m.FundingMultiple + } + return 0 } // An object describing a derivative market in the Injective Futures Protocol. @@ -143,41 +241,42 @@ type DerivativeMarket struct { Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` // Address of the oracle for the derivative contract Oracle string `protobuf:"bytes,2,opt,name=oracle,proto3" json:"oracle,omitempty"` - // Address of the base currency for the derivative contract - BaseCurrency string `protobuf:"bytes,3,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` - // Random number to faciltate uniqueness of the derivative market ID - Nonce string `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` + // Address of the quote currency denomination for the derivative contract + QuoteDenom string `protobuf:"bytes,3,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` // Unique market ID. - MarketId string `protobuf:"bytes,5,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - // If false, then the pair is suspended and trades cannot be made. - Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled,omitempty"` - // exchange address - ExchangeAddress string `protobuf:"bytes,7,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` - // price factor - PriceFactor string `protobuf:"bytes,8,opt,name=price_factor,json=priceFactor,proto3" json:"price_factor,omitempty"` - // index price - IndexPrice string `protobuf:"bytes,9,opt,name=index_price,json=indexPrice,proto3" json:"index_price,omitempty"` - // InitialMarginRatioPermyriad - InitialMarginRatio string `protobuf:"bytes,10,opt,name=initial_margin_ratio,json=initialMarginRatio,proto3" json:"initial_margin_ratio,omitempty"` - // MaintenanceMarginRatioPermyriad - MaintenanceMarginRatio string `protobuf:"bytes,11,opt,name=maintenance_margin_ratio,json=maintenanceMarginRatio,proto3" json:"maintenance_margin_ratio,omitempty"` - // MakerTxFeePermyriad - MakerTxFee string `protobuf:"bytes,12,opt,name=maker_tx_fee,json=makerTxFee,proto3" json:"maker_tx_fee,omitempty"` - // TakerTxFeePermyriad - TakerTxFee string `protobuf:"bytes,13,opt,name=taker_tx_fee,json=takerTxFee,proto3" json:"taker_tx_fee,omitempty"` - // NextFundingTimestamp in seconds - NextFundingTimestamp string `protobuf:"bytes,14,opt,name=next_funding_timestamp,json=nextFundingTimestamp,proto3" json:"next_funding_timestamp,omitempty"` - // FundingInterval in seconds - FundingInterval string `protobuf:"bytes,15,opt,name=funding_interval,json=fundingInterval,proto3" json:"funding_interval,omitempty"` - // Cumulative Funding in seconds - CumulativeFunding string `protobuf:"bytes,16,opt,name=cumulative_funding,json=cumulativeFunding,proto3" json:"cumulative_funding,omitempty"` + MarketId string `protobuf:"bytes,4,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // mark_price defines the current mark price of a derivative market + MarkPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=mark_price,json=markPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"mark_price"` + // initial_margin_ratio defines the initial margin ratio of a derivative market + InitialMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=initial_margin_ratio,json=initialMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"initial_margin_ratio"` + // maintenance_margin_ratio defines the maintenance margin ratio of a derivative market + MaintenanceMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=maintenance_margin_ratio,json=maintenanceMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maintenance_margin_ratio"` + // maker_fee_rate defines the maker fee rate of a derivative market + MakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=maker_fee_rate,json=makerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maker_fee_rate"` + // taker_fee_rate defines the taker fee rate of a derivative market + TakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=taker_fee_rate,json=takerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"taker_fee_rate"` + // relayer_fee_share_rate defines the percentage of the transaction fee shared with the relayer in a derivative market + RelayerFeeShareRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=relayer_fee_share_rate,json=relayerFeeShareRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"relayer_fee_share_rate"` + // hourly_funding_rate_cap defines the maximum absolute value of the hourly funding rate + HourlyFundingRateCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=hourly_funding_rate_cap,json=hourlyFundingRateCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"hourly_funding_rate_cap"` + // hourly_interest_rate defines the hourly interest rate + HourlyInterestRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=hourly_interest_rate,json=hourlyInterestRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"hourly_interest_rate"` + // expiry_or_next_funding_timestamp defines the expiration time for a time expiry futures market + // or the next funding timestamp in seconds of a perpetual market + ExpiryOrNextFundingTimestamp int64 `protobuf:"varint,13,opt,name=expiry_or_next_funding_timestamp,json=expiryOrNextFundingTimestamp,proto3" json:"expiry_or_next_funding_timestamp,omitempty"` + // funding_interval defines the next funding interval in seconds of a derivative market. Zero for TEFs + FundingInterval int64 `protobuf:"varint,14,opt,name=funding_interval,json=fundingInterval,proto3" json:"funding_interval,omitempty"` + // cumulative_funding defines the cumulative funding of a derivative market. Zero for TEFs + CumulativeFunding github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,15,opt,name=cumulative_funding,json=cumulativeFunding,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cumulative_funding"` + // Status of the market + Status MarketStatus `protobuf:"varint,16,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` } 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_2116e2804e9c53f9, []int{0} + return fileDescriptor_2116e2804e9c53f9, []int{1} } func (m *DerivativeMarket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -220,16 +319,9 @@ func (m *DerivativeMarket) GetOracle() string { return "" } -func (m *DerivativeMarket) GetBaseCurrency() string { +func (m *DerivativeMarket) GetQuoteDenom() string { if m != nil { - return m.BaseCurrency - } - return "" -} - -func (m *DerivativeMarket) GetNonce() string { - if m != nil { - return m.Nonce + return m.QuoteDenom } return "" } @@ -241,108 +333,52 @@ func (m *DerivativeMarket) GetMarketId() string { return "" } -func (m *DerivativeMarket) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *DerivativeMarket) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -func (m *DerivativeMarket) GetPriceFactor() string { - if m != nil { - return m.PriceFactor - } - return "" -} - -func (m *DerivativeMarket) GetIndexPrice() string { - if m != nil { - return m.IndexPrice - } - return "" -} - -func (m *DerivativeMarket) GetInitialMarginRatio() string { - if m != nil { - return m.InitialMarginRatio - } - return "" -} - -func (m *DerivativeMarket) GetMaintenanceMarginRatio() string { - if m != nil { - return m.MaintenanceMarginRatio - } - return "" -} - -func (m *DerivativeMarket) GetMakerTxFee() string { - if m != nil { - return m.MakerTxFee - } - return "" -} - -func (m *DerivativeMarket) GetTakerTxFee() string { +func (m *DerivativeMarket) GetExpiryOrNextFundingTimestamp() int64 { if m != nil { - return m.TakerTxFee + return m.ExpiryOrNextFundingTimestamp } - return "" -} - -func (m *DerivativeMarket) GetNextFundingTimestamp() string { - if m != nil { - return m.NextFundingTimestamp - } - return "" + return 0 } -func (m *DerivativeMarket) GetFundingInterval() string { +func (m *DerivativeMarket) GetFundingInterval() int64 { if m != nil { return m.FundingInterval } - return "" + return 0 } -func (m *DerivativeMarket) GetCumulativeFunding() string { +func (m *DerivativeMarket) GetStatus() MarketStatus { if m != nil { - return m.CumulativeFunding + return m.Status } - return "" + return MarketStatus_Active } // An object describing trade pair of two assets. 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"` + // Coin denom used for the base asset + BaseDenom string `protobuf:"bytes,2,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // Coin used for the quote asset + QuoteDenom string `protobuf:"bytes,3,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` + // maker_fee_rate defines the fee percentage makers pay when trading + MakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=maker_fee_rate,json=makerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maker_fee_rate"` + // taker_fee_rate defines the fee percentage takers pay when trading + TakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=taker_fee_rate,json=takerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"taker_fee_rate"` + // relayer_fee_share_rate defines the percentage of the transaction fee shared with the relayer in a derivative market + RelayerFeeShareRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=relayer_fee_share_rate,json=relayerFeeShareRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"relayer_fee_share_rate"` // 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"` + MarketId string `protobuf:"bytes,7,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // Status of the market + Status MarketStatus `protobuf:"varint,8,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` } 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} + return fileDescriptor_2116e2804e9c53f9, []int{2} } func (m *SpotMarket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -378,88 +414,96 @@ func (m *SpotMarket) GetTicker() string { return "" } -func (m *SpotMarket) GetBaseAsset() string { +func (m *SpotMarket) GetBaseDenom() string { if m != nil { - return m.BaseAsset + return m.BaseDenom } return "" } -func (m *SpotMarket) GetQuoteAsset() string { +func (m *SpotMarket) GetQuoteDenom() string { if m != nil { - return m.QuoteAsset + return m.QuoteDenom } return "" } -func (m *SpotMarket) GetMakerTxFee() string { +func (m *SpotMarket) GetMarketId() string { if m != nil { - return m.MakerTxFee + return m.MarketId } return "" } -func (m *SpotMarket) GetTakerTxFee() string { +func (m *SpotMarket) GetStatus() MarketStatus { if m != nil { - return m.TakerTxFee + return m.Status } - return "" + return MarketStatus_Active } -func (m *SpotMarket) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" +// An subaccount's deposit for a given base currency +type Deposit struct { + AvailableBalance github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=available_balance,json=availableBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"available_balance"` + TotalBalance github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=total_balance,json=totalBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_balance"` } -func (m *SpotMarket) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false +func (m *Deposit) Reset() { *m = Deposit{} } +func (m *Deposit) String() string { return proto.CompactTextString(m) } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{3} } - -func (m *SpotMarket) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (m *Deposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Deposit.Merge(m, src) +} +func (m *Deposit) XXX_Size() int { + return m.Size() +} +func (m *Deposit) XXX_DiscardUnknown() { + xxx_messageInfo_Deposit.DiscardUnknown(m) } -// 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"` +var xxx_messageInfo_Deposit proto.InternalMessageInfo + +type OrderInfo struct { + // bytes32 subaccount ID that created the order + SubaccountId string `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + // address fee_recipient address that will receive fees for the order + FeeRecipient string `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty"` + // price of the base asset + Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + // quantity of the base asset + Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity"` } -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 *OrderInfo) Reset() { *m = OrderInfo{} } +func (m *OrderInfo) String() string { return proto.CompactTextString(m) } +func (*OrderInfo) ProtoMessage() {} +func (*OrderInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{4} } -func (m *SpotLimitOrder) XXX_Unmarshal(b []byte) error { +func (m *OrderInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SpotLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OrderInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SpotLimitOrder.Marshal(b, m, deterministic) + return xxx_messageInfo_OrderInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -469,107 +513,186 @@ func (m *SpotLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *SpotLimitOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpotLimitOrder.Merge(m, src) +func (m *OrderInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrderInfo.Merge(m, src) } -func (m *SpotLimitOrder) XXX_Size() int { +func (m *OrderInfo) XXX_Size() int { return m.Size() } -func (m *SpotLimitOrder) XXX_DiscardUnknown() { - xxx_messageInfo_SpotLimitOrder.DiscardUnknown(m) +func (m *OrderInfo) XXX_DiscardUnknown() { + xxx_messageInfo_OrderInfo.DiscardUnknown(m) } -var xxx_messageInfo_SpotLimitOrder proto.InternalMessageInfo +var xxx_messageInfo_OrderInfo proto.InternalMessageInfo -func (m *SpotLimitOrder) GetSubaccountID() string { +func (m *OrderInfo) GetSubaccountId() string { if m != nil { - return m.SubaccountID + return m.SubaccountId } return "" } -func (m *SpotLimitOrder) GetSender() string { +func (m *OrderInfo) GetFeeRecipient() string { if m != nil { - return m.Sender + return m.FeeRecipient } return "" } -func (m *SpotLimitOrder) GetFeeRecipient() string { +type SpotOrder struct { + // market_id represents the unique ID of the market + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,2,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + // order types + OrderType OrderType `protobuf:"varint,3,opt,name=order_type,json=orderType,proto3,enum=injective.exchange.v1beta1.OrderType" json:"order_type,omitempty"` + // trigger_price is the trigger price used by stop/take orders + TriggerPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=trigger_price,json=triggerPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"trigger_price"` + // Arbitrary number to facilitate uniqueness of the order's hash. + Salt uint32 `protobuf:"varint,5,opt,name=salt,proto3" json:"salt,omitempty"` +} + +func (m *SpotOrder) Reset() { *m = SpotOrder{} } +func (m *SpotOrder) String() string { return proto.CompactTextString(m) } +func (*SpotOrder) ProtoMessage() {} +func (*SpotOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{5} +} +func (m *SpotOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotOrder.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 *SpotOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotOrder.Merge(m, src) +} +func (m *SpotOrder) XXX_Size() int { + return m.Size() +} +func (m *SpotOrder) XXX_DiscardUnknown() { + xxx_messageInfo_SpotOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_SpotOrder proto.InternalMessageInfo + +func (m *SpotOrder) GetMarketId() string { if m != nil { - return m.FeeRecipient + return m.MarketId } return "" } -func (m *SpotLimitOrder) GetExpiry() uint64 { +func (m *SpotOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.Expiry + return m.OrderInfo } - return 0 + return OrderInfo{} } -func (m *SpotLimitOrder) GetSupplyAmount() string { +func (m *SpotOrder) GetOrderType() OrderType { if m != nil { - return m.SupplyAmount + return m.OrderType } - return "" + return OrderType_BUY } -func (m *SpotLimitOrder) GetDemandAmount() string { +func (m *SpotOrder) GetSalt() uint32 { if m != nil { - return m.DemandAmount + return m.Salt } - return "" + return 0 } -func (m *SpotLimitOrder) GetFilledAmount() string { - if m != nil { - return m.FilledAmount +// A valid Spot limit order with Metadata. +type SpotLimitOrder struct { + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,1,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + // order types + OrderType OrderType `protobuf:"varint,2,opt,name=order_type,json=orderType,proto3,enum=injective.exchange.v1beta1.OrderType" json:"order_type,omitempty"` + // the amount of the quantity remaining fillable + Fillable github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fillable,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fillable"` + // trigger_price is the trigger price used by stop/take orders + TriggerPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=trigger_price,json=triggerPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"trigger_price"` + Hash []byte `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,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{6} +} +func (m *SpotLimitOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotLimitOrder.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 *SpotLimitOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotLimitOrder.Merge(m, src) +} +func (m *SpotLimitOrder) XXX_Size() int { + return m.Size() +} +func (m *SpotLimitOrder) XXX_DiscardUnknown() { + xxx_messageInfo_SpotLimitOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_SpotLimitOrder proto.InternalMessageInfo -func (m *SpotLimitOrder) GetCreationBlockHeight() int64 { +func (m *SpotLimitOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.CreationBlockHeight + return m.OrderInfo } - return 0 + return OrderInfo{} } -func (m *SpotLimitOrder) GetOrderType() SpotLimitOrder_LimitOrderType { +func (m *SpotLimitOrder) GetOrderType() OrderType { if m != nil { return m.OrderType } - return SpotLimitOrder_LIMIT + return OrderType_BUY } -func (m *SpotLimitOrder) GetTriggerPrice() string { +func (m *SpotLimitOrder) GetHash() []byte { if m != nil { - return m.TriggerPrice + return m.Hash } - return "" + return nil } -// A valid signed Spot market order with Metadata. +// A valid 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"` + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,1,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + BalanceHold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=balance_hold,json=balanceHold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"balance_hold"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,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} + return fileDescriptor_2116e2804e9c53f9, []int{7} } func (m *SpotMarketOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -598,86 +721,47 @@ func (m *SpotMarketOrder) XXX_DiscardUnknown() { var xxx_messageInfo_SpotMarketOrder proto.InternalMessageInfo -func (m *SpotMarketOrder) GetSubaccountID() string { - if m != nil { - return m.SubaccountID - } - return "" -} - -func (m *SpotMarketOrder) GetFeeRecipient() string { - if m != nil { - return m.FeeRecipient - } - return "" -} - -func (m *SpotMarketOrder) GetQuantity() string { +func (m *SpotMarketOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.Quantity + return m.OrderInfo } - return "" + return OrderInfo{} } -func (m *SpotMarketOrder) GetFundsSupplied() string { +func (m *SpotMarketOrder) GetHash() string { if m != nil { - return m.FundsSupplied + return m.Hash } return "" } -func (m *SpotMarketOrder) GetOrderType() SpotMarketOrder_MarketOrderType { - if m != nil { - return m.OrderType - } - return SpotMarketOrder_MARKET -} - -func (m *SpotMarketOrder) GetTriggerPrice() string { - if m != nil { - return m.TriggerPrice - } - return "" +type DerivativeOrder struct { + // market_id represents the unique ID of the market + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,2,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + // order types + OrderType OrderType `protobuf:"varint,3,opt,name=order_type,json=orderType,proto3,enum=injective.exchange.v1beta1.OrderType" json:"order_type,omitempty"` + // margin is the margin used by the limit order + Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` + // trigger_price is the trigger price used by stop/take orders + TriggerPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=trigger_price,json=triggerPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"trigger_price"` + // Arbitrary number to facilitate uniqueness of the order's hash. + Salt uint32 `protobuf:"varint,6,opt,name=salt,proto3" json:"salt,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 *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 *DerivativeOrder) Reset() { *m = DerivativeOrder{} } +func (m *DerivativeOrder) String() string { return proto.CompactTextString(m) } +func (*DerivativeOrder) ProtoMessage() {} +func (*DerivativeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{8} } -func (m *BaseSpotOrder) XXX_Unmarshal(b []byte) error { +func (m *DerivativeOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BaseSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BaseSpotOrder.Marshal(b, m, deterministic) + return xxx_messageInfo_DerivativeOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -687,160 +771,73 @@ func (m *BaseSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *BaseSpotOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseSpotOrder.Merge(m, src) +func (m *DerivativeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_DerivativeOrder.Merge(m, src) } -func (m *BaseSpotOrder) XXX_Size() int { +func (m *DerivativeOrder) XXX_Size() int { return m.Size() } -func (m *BaseSpotOrder) XXX_DiscardUnknown() { - xxx_messageInfo_BaseSpotOrder.DiscardUnknown(m) +func (m *DerivativeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_DerivativeOrder.DiscardUnknown(m) } -var xxx_messageInfo_BaseSpotOrder proto.InternalMessageInfo +var xxx_messageInfo_DerivativeOrder proto.InternalMessageInfo -func (m *BaseSpotOrder) GetChainId() int64 { +func (m *DerivativeOrder) GetMarketId() string { if m != nil { - return m.ChainId + return m.MarketId } - return 0 + return "" } -func (m *BaseSpotOrder) GetSubaccountID() string { +func (m *DerivativeOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.SubaccountID + return m.OrderInfo } - return "" -} - -func (m *BaseSpotOrder) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *BaseSpotOrder) GetFeeRecipient() string { - if m != nil { - return m.FeeRecipient - } - return "" -} - -func (m *BaseSpotOrder) GetExpiry() uint64 { - if m != nil { - return m.Expiry - } - return 0 -} - -func (m *BaseSpotOrder) GetMarketID() string { - if m != nil { - return m.MarketID - } - return "" -} - -func (m *BaseSpotOrder) GetSupplyAmount() string { - if m != nil { - return m.SupplyAmount - } - return "" + return OrderInfo{} } -func (m *BaseSpotOrder) GetDemandAmount() string { +func (m *DerivativeOrder) GetOrderType() OrderType { if m != nil { - return m.DemandAmount + return m.OrderType } - return "" + return OrderType_BUY } -func (m *BaseSpotOrder) GetSalt() uint64 { +func (m *DerivativeOrder) GetSalt() uint32 { if m != nil { return m.Salt } return 0 } -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 "" -} - -func (m *BaseSpotOrder) GetSignature() string { - if m != nil { - return m.Signature - } - return "" -} - -// 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 *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} +// A valid Derivative limit order with Metadata. +type DerivativeLimitOrder struct { + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,1,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + // order types + OrderType OrderType `protobuf:"varint,2,opt,name=order_type,json=orderType,proto3,enum=injective.exchange.v1beta1.OrderType" json:"order_type,omitempty"` + // margin is the margin used by the limit order + Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` + // the amount of the quantity remaining fillable + Fillable github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=fillable,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fillable"` + // trigger_price is the trigger price used by stop/take orders + TriggerPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=trigger_price,json=triggerPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"trigger_price"` + Hash []byte `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *DerivativeLimitOrder) Reset() { *m = DerivativeLimitOrder{} } +func (m *DerivativeLimitOrder) String() string { return proto.CompactTextString(m) } +func (*DerivativeLimitOrder) ProtoMessage() {} +func (*DerivativeLimitOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{9} } -func (m *BaseOrder) XXX_Unmarshal(b []byte) error { +func (m *DerivativeLimitOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BaseOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DerivativeLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BaseOrder.Marshal(b, m, deterministic) + return xxx_messageInfo_DerivativeLimitOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -850,161 +847,59 @@ 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 *DerivativeLimitOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_DerivativeLimitOrder.Merge(m, src) } -func (m *BaseOrder) XXX_Size() int { +func (m *DerivativeLimitOrder) XXX_Size() int { return m.Size() } -func (m *BaseOrder) XXX_DiscardUnknown() { - xxx_messageInfo_BaseOrder.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseOrder proto.InternalMessageInfo - -func (m *BaseOrder) GetChainId() int64 { - if m != nil { - return m.ChainId - } - return 0 -} - -func (m *BaseOrder) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -func (m *BaseOrder) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} - -func (m *BaseOrder) GetTakerAddress() string { - if m != nil { - return m.TakerAddress - } - return "" -} - -func (m *BaseOrder) GetFeeRecipientAddress() string { - if m != nil { - return m.FeeRecipientAddress - } - return "" -} - -func (m *BaseOrder) GetSenderAddress() string { - if m != nil { - return m.SenderAddress - } - return "" -} - -func (m *BaseOrder) GetMakerAssetAmount() string { - if m != nil { - return m.MakerAssetAmount - } - return "" -} - -func (m *BaseOrder) GetTakerAssetAmount() string { - if m != nil { - return m.TakerAssetAmount - } - return "" -} - -func (m *BaseOrder) GetMakerFee() string { - if m != nil { - return m.MakerFee - } - return "" -} - -func (m *BaseOrder) GetTakerFee() string { - if m != nil { - return m.TakerFee - } - return "" -} - -func (m *BaseOrder) GetExpirationTimeSeconds() string { - if m != nil { - return m.ExpirationTimeSeconds - } - return "" -} - -func (m *BaseOrder) GetSalt() string { - if m != nil { - return m.Salt - } - return "" -} - -func (m *BaseOrder) GetMakerAssetData() string { - if m != nil { - return m.MakerAssetData - } - return "" +func (m *DerivativeLimitOrder) XXX_DiscardUnknown() { + xxx_messageInfo_DerivativeLimitOrder.DiscardUnknown(m) } -func (m *BaseOrder) GetTakerAssetData() string { - if m != nil { - return m.TakerAssetData - } - return "" -} +var xxx_messageInfo_DerivativeLimitOrder proto.InternalMessageInfo -func (m *BaseOrder) GetMakerFeeAssetData() string { +func (m *DerivativeLimitOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.MakerFeeAssetData + return m.OrderInfo } - return "" + return OrderInfo{} } -func (m *BaseOrder) GetTakerFeeAssetData() string { +func (m *DerivativeLimitOrder) GetOrderType() OrderType { if m != nil { - return m.TakerFeeAssetData + return m.OrderType } - return "" + return OrderType_BUY } -func (m *BaseOrder) GetSignature() string { +func (m *DerivativeLimitOrder) GetHash() []byte { if m != nil { - return m.Signature + return m.Hash } - return "" + return nil } -// 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"` +// A valid Derivative market order with Metadata. +type DerivativeMarketOrder struct { + // order_info contains the information of the order + OrderInfo OrderInfo `protobuf:"bytes,1,opt,name=order_info,json=orderInfo,proto3" json:"order_info"` + MarginHold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=margin_hold,json=marginHold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin_hold"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,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 *DerivativeMarketOrder) Reset() { *m = DerivativeMarketOrder{} } +func (m *DerivativeMarketOrder) String() string { return proto.CompactTextString(m) } +func (*DerivativeMarketOrder) ProtoMessage() {} +func (*DerivativeMarketOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{10} } -func (m *Order) XXX_Unmarshal(b []byte) error { +func (m *DerivativeMarketOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DerivativeMarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Order.Marshal(b, m, deterministic) + return xxx_messageInfo_DerivativeMarketOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1014,92 +909,53 @@ 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 *DerivativeMarketOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_DerivativeMarketOrder.Merge(m, src) } -func (m *Order) XXX_Size() int { +func (m *DerivativeMarketOrder) XXX_Size() int { return m.Size() } -func (m *Order) XXX_DiscardUnknown() { - xxx_messageInfo_Order.DiscardUnknown(m) -} - -var xxx_messageInfo_Order proto.InternalMessageInfo - -func (m *Order) GetOrder() *BaseOrder { - if m != nil { - return m.Order - } - return nil -} - -func (m *Order) GetTradePairHash() string { - if m != nil { - return m.TradePairHash - } - return "" -} - -func (m *Order) GetFilledAmount() string { - if m != nil { - return m.FilledAmount - } - return "" -} - -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 *DerivativeMarketOrder) XXX_DiscardUnknown() { + xxx_messageInfo_DerivativeMarketOrder.DiscardUnknown(m) } -func (m *Order) GetSubaccountID() string { - if m != nil { - return m.SubaccountID - } - return "" -} +var xxx_messageInfo_DerivativeMarketOrder proto.InternalMessageInfo -func (m *Order) GetOrderType() uint64 { +func (m *DerivativeMarketOrder) GetOrderInfo() OrderInfo { if m != nil { - return m.OrderType + return m.OrderInfo } - return 0 + return OrderInfo{} } -func (m *Order) GetTriggerPrice() string { +func (m *DerivativeMarketOrder) GetHash() string { if m != nil { - return m.TriggerPrice + return m.Hash } 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"` +type Position struct { + IsLong bool `protobuf:"varint,1,opt,name=isLong,proto3" json:"isLong,omitempty"` + Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity"` + EntryPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=entry_price,json=entryPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"entry_price"` + Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` + HoldQuantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=hold_quantity,json=holdQuantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"hold_quantity"` + CumulativeFundingEntry github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=cumulative_funding_entry,json=cumulativeFundingEntry,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cumulative_funding_entry"` } -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 *Position) Reset() { *m = Position{} } +func (m *Position) String() string { return proto.CompactTextString(m) } +func (*Position) ProtoMessage() {} +func (*Position) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{11} } -func (m *MarginInfo) XXX_Unmarshal(b []byte) error { +func (m *Position) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MarginInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_Position.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1109,51 +965,43 @@ 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 *Position) XXX_Merge(src proto.Message) { + xxx_messageInfo_Position.Merge(m, src) } -func (m *MarginInfo) XXX_Size() int { +func (m *Position) XXX_Size() int { return m.Size() } -func (m *MarginInfo) XXX_DiscardUnknown() { - xxx_messageInfo_MarginInfo.DiscardUnknown(m) +func (m *Position) XXX_DiscardUnknown() { + xxx_messageInfo_Position.DiscardUnknown(m) } -var xxx_messageInfo_MarginInfo proto.InternalMessageInfo - -func (m *MarginInfo) GetMarginHold() string { - if m != nil { - return m.MarginHold - } - return "" -} +var xxx_messageInfo_Position proto.InternalMessageInfo -func (m *MarginInfo) GetTotalDeposits() string { +func (m *Position) GetIsLong() bool { if m != nil { - return m.TotalDeposits + return m.IsLong } - return "" + return false } -// 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"` +type MarketOrderIndicator struct { + // market_id represents the unique ID of the market + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + IsBuy bool `protobuf:"varint,2,opt,name=isBuy,proto3" json:"isBuy,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 *MarketOrderIndicator) Reset() { *m = MarketOrderIndicator{} } +func (m *MarketOrderIndicator) String() string { return proto.CompactTextString(m) } +func (*MarketOrderIndicator) ProtoMessage() {} +func (*MarketOrderIndicator) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{12} } -func (m *BaseCurrencyMarginInfo) XXX_Unmarshal(b []byte) error { +func (m *MarketOrderIndicator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BaseCurrencyMarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MarketOrderIndicator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BaseCurrencyMarginInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_MarketOrderIndicator.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1163,58 +1011,53 @@ func (m *BaseCurrencyMarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *BaseCurrencyMarginInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseCurrencyMarginInfo.Merge(m, src) +func (m *MarketOrderIndicator) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketOrderIndicator.Merge(m, src) } -func (m *BaseCurrencyMarginInfo) XXX_Size() int { +func (m *MarketOrderIndicator) XXX_Size() int { return m.Size() } -func (m *BaseCurrencyMarginInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BaseCurrencyMarginInfo.DiscardUnknown(m) +func (m *MarketOrderIndicator) XXX_DiscardUnknown() { + xxx_messageInfo_MarketOrderIndicator.DiscardUnknown(m) } -var xxx_messageInfo_BaseCurrencyMarginInfo proto.InternalMessageInfo - -func (m *BaseCurrencyMarginInfo) GetMarginHold() string { - if m != nil { - return m.MarginHold - } - return "" -} +var xxx_messageInfo_MarketOrderIndicator proto.InternalMessageInfo -func (m *BaseCurrencyMarginInfo) GetTotalDeposits() string { +func (m *MarketOrderIndicator) GetMarketId() string { if m != nil { - return m.TotalDeposits + return m.MarketId } return "" } -func (m *BaseCurrencyMarginInfo) GetBaseCurrency() string { +func (m *MarketOrderIndicator) GetIsBuy() bool { if m != nil { - return m.BaseCurrency + return m.IsBuy } - return "" + return false } -// 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"` +type TradeLog struct { + Quantity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quantity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quantity"` + Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + // bytes32 subaccount ID that executed the trade + SubaccountId string `protobuf:"bytes,3,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + Fee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee"` + Hash string `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,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 *TradeLog) Reset() { *m = TradeLog{} } +func (m *TradeLog) String() string { return proto.CompactTextString(m) } +func (*TradeLog) ProtoMessage() {} +func (*TradeLog) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{13} } -func (m *SubaccountInfo) XXX_Unmarshal(b []byte) error { +func (m *TradeLog) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SubaccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TradeLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SubaccountInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_TradeLog.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1224,57 +1067,51 @@ 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 *TradeLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_TradeLog.Merge(m, src) } -func (m *SubaccountInfo) XXX_Size() int { +func (m *TradeLog) XXX_Size() int { return m.Size() } -func (m *SubaccountInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SubaccountInfo.DiscardUnknown(m) +func (m *TradeLog) XXX_DiscardUnknown() { + xxx_messageInfo_TradeLog.DiscardUnknown(m) } -var xxx_messageInfo_SubaccountInfo proto.InternalMessageInfo - -func (m *SubaccountInfo) GetBaseCurrencyMarginInfo() []*BaseCurrencyMarginInfo { - if m != nil { - return m.BaseCurrencyMarginInfo - } - return nil -} +var xxx_messageInfo_TradeLog proto.InternalMessageInfo -func (m *SubaccountInfo) GetNonce() string { +func (m *TradeLog) GetSubaccountId() string { if m != nil { - return m.Nonce + return m.SubaccountId } return "" } -func (m *SubaccountInfo) GetSubaccountId() string { +func (m *TradeLog) GetHash() string { if m != nil { - return m.SubaccountId + return m.Hash } 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"` +type EventBatchSpotExecution struct { + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + IsBuy bool `protobuf:"varint,2,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"` + ExecutionType ExecutionType `protobuf:"varint,3,opt,name=executionType,proto3,enum=injective.exchange.v1beta1.ExecutionType" json:"executionType,omitempty"` + Trades []*TradeLog `protobuf:"bytes,4,rep,name=trades,proto3" json:"trades,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_2116e2804e9c53f9, []int{10} +func (m *EventBatchSpotExecution) Reset() { *m = EventBatchSpotExecution{} } +func (m *EventBatchSpotExecution) String() string { return proto.CompactTextString(m) } +func (*EventBatchSpotExecution) ProtoMessage() {} +func (*EventBatchSpotExecution) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{14} } -func (m *OrderQuoteInfo) XXX_Unmarshal(b []byte) error { +func (m *EventBatchSpotExecution) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OrderQuoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventBatchSpotExecution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OrderQuoteInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_EventBatchSpotExecution.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1284,54 +1121,64 @@ func (m *OrderQuoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *OrderQuoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderQuoteInfo.Merge(m, src) +func (m *EventBatchSpotExecution) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBatchSpotExecution.Merge(m, src) } -func (m *OrderQuoteInfo) XXX_Size() int { +func (m *EventBatchSpotExecution) XXX_Size() int { return m.Size() } -func (m *OrderQuoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_OrderQuoteInfo.DiscardUnknown(m) +func (m *EventBatchSpotExecution) XXX_DiscardUnknown() { + xxx_messageInfo_EventBatchSpotExecution.DiscardUnknown(m) } -var xxx_messageInfo_OrderQuoteInfo proto.InternalMessageInfo +var xxx_messageInfo_EventBatchSpotExecution proto.InternalMessageInfo -func (m *OrderQuoteInfo) GetMarketId() string { +func (m *EventBatchSpotExecution) GetMarketId() string { if m != nil { return m.MarketId } return "" } -func (m *OrderQuoteInfo) GetQuotes() []*OrderQuote { +func (m *EventBatchSpotExecution) GetIsBuy() bool { + if m != nil { + return m.IsBuy + } + return false +} + +func (m *EventBatchSpotExecution) GetExecutionType() ExecutionType { + if m != nil { + return m.ExecutionType + } + return ExecutionType_Market +} + +func (m *EventBatchSpotExecution) GetTrades() []*TradeLog { if m != nil { - return m.Quotes + return m.Trades } return nil } -type PositionInfo struct { - IsLong bool `protobuf:"varint,1,opt,name=isLong,proto3" json:"isLong,omitempty"` - BankruptcyPrice string `protobuf:"bytes,2,opt,name=bankruptcy_price,json=bankruptcyPrice,proto3" json:"bankruptcy_price,omitempty"` - Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` - PositionHoldQuantity string `protobuf:"bytes,4,opt,name=positionHoldQuantity,proto3" json:"positionHoldQuantity,omitempty"` - CumulativeFundingEntry string `protobuf:"bytes,5,opt,name=cumulativeFundingEntry,proto3" json:"cumulativeFundingEntry,omitempty"` - Margin string `protobuf:"bytes,6,opt,name=margin,proto3" json:"margin,omitempty"` - EntryPrice string `protobuf:"bytes,7,opt,name=entryPrice,proto3" json:"entryPrice,omitempty"` +type EventNewSpotOrders struct { + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + BuyOrders []*SpotLimitOrder `protobuf:"bytes,2,rep,name=buy_orders,json=buyOrders,proto3" json:"buy_orders,omitempty"` + SellOrders []*SpotLimitOrder `protobuf:"bytes,3,rep,name=sell_orders,json=sellOrders,proto3" json:"sell_orders,omitempty"` } -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_2116e2804e9c53f9, []int{11} +func (m *EventNewSpotOrders) Reset() { *m = EventNewSpotOrders{} } +func (m *EventNewSpotOrders) String() string { return proto.CompactTextString(m) } +func (*EventNewSpotOrders) ProtoMessage() {} +func (*EventNewSpotOrders) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{15} } -func (m *PositionInfo) XXX_Unmarshal(b []byte) error { +func (m *EventNewSpotOrders) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PositionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventNewSpotOrders) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PositionInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_EventNewSpotOrders.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1341,85 +1188,56 @@ func (m *PositionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *PositionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_PositionInfo.Merge(m, src) +func (m *EventNewSpotOrders) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventNewSpotOrders.Merge(m, src) } -func (m *PositionInfo) XXX_Size() int { +func (m *EventNewSpotOrders) XXX_Size() int { return m.Size() } -func (m *PositionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_PositionInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_PositionInfo proto.InternalMessageInfo - -func (m *PositionInfo) GetIsLong() bool { - if m != nil { - return m.IsLong - } - return false -} - -func (m *PositionInfo) GetBankruptcyPrice() string { - if m != nil { - return m.BankruptcyPrice - } - return "" -} - -func (m *PositionInfo) GetQuantity() string { - if m != nil { - return m.Quantity - } - return "" +func (m *EventNewSpotOrders) XXX_DiscardUnknown() { + xxx_messageInfo_EventNewSpotOrders.DiscardUnknown(m) } -func (m *PositionInfo) GetPositionHoldQuantity() string { - if m != nil { - return m.PositionHoldQuantity - } - return "" -} +var xxx_messageInfo_EventNewSpotOrders proto.InternalMessageInfo -func (m *PositionInfo) GetCumulativeFundingEntry() string { +func (m *EventNewSpotOrders) GetMarketId() string { if m != nil { - return m.CumulativeFundingEntry + return m.MarketId } return "" } -func (m *PositionInfo) GetMargin() string { +func (m *EventNewSpotOrders) GetBuyOrders() []*SpotLimitOrder { if m != nil { - return m.Margin + return m.BuyOrders } - return "" + return nil } -func (m *PositionInfo) GetEntryPrice() string { +func (m *EventNewSpotOrders) GetSellOrders() []*SpotLimitOrder { if m != nil { - return m.EntryPrice + return m.SellOrders } - return "" + return nil } -// An order quote with fillable data -type OrderQuote struct { - Order *BaseOrder `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` - FillableAmount string `protobuf:"bytes,2,opt,name=fillable_amount,json=fillableAmount,proto3" json:"fillable_amount,omitempty"` +type EventCancelSpotOrder struct { + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + Order SpotLimitOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` } -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_2116e2804e9c53f9, []int{12} +func (m *EventCancelSpotOrder) Reset() { *m = EventCancelSpotOrder{} } +func (m *EventCancelSpotOrder) String() string { return proto.CompactTextString(m) } +func (*EventCancelSpotOrder) ProtoMessage() {} +func (*EventCancelSpotOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{16} } -func (m *OrderQuote) XXX_Unmarshal(b []byte) error { +func (m *EventCancelSpotOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OrderQuote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventCancelSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OrderQuote.Marshal(b, m, deterministic) + return xxx_messageInfo_EventCancelSpotOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1429,52 +1247,48 @@ func (m *OrderQuote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *OrderQuote) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderQuote.Merge(m, src) +func (m *EventCancelSpotOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCancelSpotOrder.Merge(m, src) } -func (m *OrderQuote) XXX_Size() int { +func (m *EventCancelSpotOrder) XXX_Size() int { return m.Size() } -func (m *OrderQuote) XXX_DiscardUnknown() { - xxx_messageInfo_OrderQuote.DiscardUnknown(m) +func (m *EventCancelSpotOrder) XXX_DiscardUnknown() { + xxx_messageInfo_EventCancelSpotOrder.DiscardUnknown(m) } -var xxx_messageInfo_OrderQuote proto.InternalMessageInfo +var xxx_messageInfo_EventCancelSpotOrder proto.InternalMessageInfo -func (m *OrderQuote) GetOrder() *BaseOrder { +func (m *EventCancelSpotOrder) GetMarketId() string { if m != nil { - return m.Order + return m.MarketId } - return nil + return "" } -func (m *OrderQuote) GetFillableAmount() string { +func (m *EventCancelSpotOrder) GetOrder() SpotLimitOrder { if m != nil { - return m.FillableAmount + return m.Order } - return "" + return SpotLimitOrder{} } -// An orderbook price level -type PriceLevel struct { - // price - P string `protobuf:"bytes,1,opt,name=p,proto3" json:"p,omitempty"` - // quantity - Q string `protobuf:"bytes,2,opt,name=q,proto3" json:"q,omitempty"` +type EventSpotMarketUpdate struct { + Market SpotMarket `protobuf:"bytes,1,opt,name=market,proto3" json:"market"` } -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_2116e2804e9c53f9, []int{13} +func (m *EventSpotMarketUpdate) Reset() { *m = EventSpotMarketUpdate{} } +func (m *EventSpotMarketUpdate) String() string { return proto.CompactTextString(m) } +func (*EventSpotMarketUpdate) ProtoMessage() {} +func (*EventSpotMarketUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{17} } -func (m *PriceLevel) XXX_Unmarshal(b []byte) error { +func (m *EventSpotMarketUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PriceLevel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventSpotMarketUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PriceLevel.Marshal(b, m, deterministic) + return xxx_messageInfo_EventSpotMarketUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1484,52 +1298,43 @@ func (m *PriceLevel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *PriceLevel) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriceLevel.Merge(m, src) +func (m *EventSpotMarketUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSpotMarketUpdate.Merge(m, src) } -func (m *PriceLevel) XXX_Size() int { +func (m *EventSpotMarketUpdate) XXX_Size() int { return m.Size() } -func (m *PriceLevel) XXX_DiscardUnknown() { - xxx_messageInfo_PriceLevel.DiscardUnknown(m) +func (m *EventSpotMarketUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_EventSpotMarketUpdate.DiscardUnknown(m) } -var xxx_messageInfo_PriceLevel proto.InternalMessageInfo - -func (m *PriceLevel) GetP() string { - if m != nil { - return m.P - } - return "" -} +var xxx_messageInfo_EventSpotMarketUpdate proto.InternalMessageInfo -func (m *PriceLevel) GetQ() string { +func (m *EventSpotMarketUpdate) GetMarket() SpotMarket { if m != nil { - return m.Q + return m.Market } - return "" + return SpotMarket{} } -// 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"` +type EventDepositWithdraw struct { + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } -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 *EventDepositWithdraw) Reset() { *m = EventDepositWithdraw{} } +func (m *EventDepositWithdraw) String() string { return proto.CompactTextString(m) } +func (*EventDepositWithdraw) ProtoMessage() {} +func (*EventDepositWithdraw) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{18} } -func (m *ExchangeDomain) XXX_Unmarshal(b []byte) error { +func (m *EventDepositWithdraw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ExchangeDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventDepositWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ExchangeDomain.Marshal(b, m, deterministic) + return xxx_messageInfo_EventDepositWithdraw.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1539,63 +1344,56 @@ func (m *ExchangeDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *ExchangeDomain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExchangeDomain.Merge(m, src) +func (m *EventDepositWithdraw) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDepositWithdraw.Merge(m, src) } -func (m *ExchangeDomain) XXX_Size() int { +func (m *EventDepositWithdraw) XXX_Size() int { return m.Size() } -func (m *ExchangeDomain) XXX_DiscardUnknown() { - xxx_messageInfo_ExchangeDomain.DiscardUnknown(m) +func (m *EventDepositWithdraw) XXX_DiscardUnknown() { + xxx_messageInfo_EventDepositWithdraw.DiscardUnknown(m) } -var xxx_messageInfo_ExchangeDomain proto.InternalMessageInfo +var xxx_messageInfo_EventDepositWithdraw proto.InternalMessageInfo -func (m *ExchangeDomain) GetVerifyingContract() string { +func (m *EventDepositWithdraw) GetSource() string { if m != nil { - return m.VerifyingContract + return m.Source } return "" } -func (m *ExchangeDomain) GetChainId() string { +func (m *EventDepositWithdraw) GetDestination() string { if m != nil { - return m.ChainId + return m.Destination } 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_2116e2804e9c53f9, []int{15} +func (m *EventDepositWithdraw) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +type EventCancelDerivativeOrder struct { + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + Order DerivativeLimitOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` +} + +func (m *EventCancelDerivativeOrder) Reset() { *m = EventCancelDerivativeOrder{} } +func (m *EventCancelDerivativeOrder) String() string { return proto.CompactTextString(m) } +func (*EventCancelDerivativeOrder) ProtoMessage() {} +func (*EventCancelDerivativeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{19} } -func (m *SignedTransaction) XXX_Unmarshal(b []byte) error { +func (m *EventCancelDerivativeOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SignedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventCancelDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SignedTransaction.Marshal(b, m, deterministic) + return xxx_messageInfo_EventCancelDerivativeOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1605,87 +1403,57 @@ func (m *SignedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *SignedTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedTransaction.Merge(m, src) +func (m *EventCancelDerivativeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCancelDerivativeOrder.Merge(m, src) } -func (m *SignedTransaction) XXX_Size() int { +func (m *EventCancelDerivativeOrder) XXX_Size() int { return m.Size() } -func (m *SignedTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_SignedTransaction.DiscardUnknown(m) +func (m *EventCancelDerivativeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_EventCancelDerivativeOrder.DiscardUnknown(m) } -var xxx_messageInfo_SignedTransaction proto.InternalMessageInfo +var xxx_messageInfo_EventCancelDerivativeOrder proto.InternalMessageInfo -func (m *SignedTransaction) GetSalt() string { +func (m *EventCancelDerivativeOrder) GetMarketId() string { if m != nil { - return m.Salt + return m.MarketId } return "" } -func (m *SignedTransaction) GetSignerAddress() string { +func (m *EventCancelDerivativeOrder) GetOrder() DerivativeLimitOrder { if m != nil { - return m.SignerAddress + return m.Order } - 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 "" + return DerivativeLimitOrder{} } 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.RegisterEnum("injective.exchange.v1beta1.MarketStatus", MarketStatus_name, MarketStatus_value) + proto.RegisterEnum("injective.exchange.v1beta1.OrderType", OrderType_name, OrderType_value) + proto.RegisterEnum("injective.exchange.v1beta1.Direction", Direction_name, Direction_value) + proto.RegisterEnum("injective.exchange.v1beta1.ExecutionType", ExecutionType_name, ExecutionType_value) + proto.RegisterType((*Params)(nil), "injective.exchange.v1beta1.Params") proto.RegisterType((*DerivativeMarket)(nil), "injective.exchange.v1beta1.DerivativeMarket") proto.RegisterType((*SpotMarket)(nil), "injective.exchange.v1beta1.SpotMarket") + proto.RegisterType((*Deposit)(nil), "injective.exchange.v1beta1.Deposit") + proto.RegisterType((*OrderInfo)(nil), "injective.exchange.v1beta1.OrderInfo") + proto.RegisterType((*SpotOrder)(nil), "injective.exchange.v1beta1.SpotOrder") 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") + proto.RegisterType((*DerivativeOrder)(nil), "injective.exchange.v1beta1.DerivativeOrder") + proto.RegisterType((*DerivativeLimitOrder)(nil), "injective.exchange.v1beta1.DerivativeLimitOrder") + proto.RegisterType((*DerivativeMarketOrder)(nil), "injective.exchange.v1beta1.DerivativeMarketOrder") + proto.RegisterType((*Position)(nil), "injective.exchange.v1beta1.Position") + proto.RegisterType((*MarketOrderIndicator)(nil), "injective.exchange.v1beta1.MarketOrderIndicator") + proto.RegisterType((*TradeLog)(nil), "injective.exchange.v1beta1.TradeLog") + proto.RegisterType((*EventBatchSpotExecution)(nil), "injective.exchange.v1beta1.EventBatchSpotExecution") + proto.RegisterType((*EventNewSpotOrders)(nil), "injective.exchange.v1beta1.EventNewSpotOrders") + proto.RegisterType((*EventCancelSpotOrder)(nil), "injective.exchange.v1beta1.EventCancelSpotOrder") + proto.RegisterType((*EventSpotMarketUpdate)(nil), "injective.exchange.v1beta1.EventSpotMarketUpdate") + proto.RegisterType((*EventDepositWithdraw)(nil), "injective.exchange.v1beta1.EventDepositWithdraw") + proto.RegisterType((*EventCancelDerivativeOrder)(nil), "injective.exchange.v1beta1.EventCancelDerivativeOrder") } func init() { @@ -1693,123 +1461,179 @@ func init() { } 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, 0x77, 0xbe, 0x33, 0xb3, 0x73, 0xfe, 0x87, 0xf0, 0x09, 0x17, 0xbf, 0x63, 0xa1, - 0xe2, 0xd7, 0x6c, 0x8f, 0xdd, 0x84, 0x43, 0x2a, 0x06, 0x6c, 0xef, 0xfa, 0x69, 0x9f, 0x29, 0xfa, - 0x34, 0x03, 0x76, 0x27, 0x32, 0x56, 0x31, 0x79, 0x94, 0x51, 0x77, 0x33, 0x89, 0xa5, 0x3e, 0xda, - 0x1c, 0xc4, 0x83, 0x58, 0xd3, 0xf6, 0xf0, 0x97, 0xd1, 0xf0, 0xde, 0x56, 0xa1, 0x77, 0xc4, 0x24, - 0xbf, 0xa6, 0xa8, 0xf5, 0x82, 0xca, 0x4b, 0xa6, 0xc8, 0x16, 0xd4, 0x15, 0x0f, 0x2f, 0x99, 0x74, - 0x9d, 0xc7, 0xce, 0x4e, 0xcb, 0xb7, 0x2b, 0xc4, 0x63, 0x49, 0xc3, 0x11, 0x73, 0x2b, 0x06, 0x37, - 0x2b, 0xf2, 0x04, 0x3a, 0x7d, 0x9a, 0xb0, 0x20, 0x9c, 0x4a, 0xc9, 0x44, 0x78, 0xeb, 0xae, 0x6a, - 0xf1, 0x1a, 0x82, 0x5f, 0x59, 0x8c, 0x6c, 0x42, 0x4d, 0xc4, 0x22, 0x64, 0x6e, 0x55, 0x0b, 0xcd, - 0x82, 0xbc, 0x0f, 0xad, 0xb1, 0x3e, 0x34, 0xe0, 0x91, 0x5b, 0xd3, 0x92, 0xa6, 0x01, 0x4e, 0x22, - 0xe2, 0x42, 0x83, 0x09, 0xda, 0x1f, 0xb1, 0xc8, 0xad, 0x3f, 0x76, 0x76, 0x9a, 0x7e, 0xba, 0x24, - 0x9f, 0x40, 0x2f, 0xbd, 0x60, 0x40, 0xa3, 0x48, 0xb2, 0x24, 0x71, 0x1b, 0x5a, 0x7b, 0x3d, 0xc5, - 0x0f, 0x0c, 0x4c, 0x7e, 0x0c, 0x6b, 0x13, 0xc9, 0x43, 0x16, 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, 0x76, 0xf7, 0x7f, 0xb9, 0xfb, 0xee, - 0x1a, 0xb7, 0x5b, 0x36, 0xeb, 0x6e, 0xfe, 0x13, 0x37, 0xf0, 0xf3, 0xbd, 0xf0, 0x83, 0x95, 0xe4, - 0x83, 0x01, 0x93, 0x3a, 0xc1, 0x6d, 0x22, 0x97, 0x30, 0x6f, 0x0f, 0xba, 0xe5, 0x0d, 0x48, 0x0b, - 0x6a, 0xa7, 0x27, 0x2f, 0x4e, 0xce, 0x7b, 0x2b, 0xa4, 0x09, 0xd5, 0xb3, 0xf3, 0x6f, 0x5e, 0xf6, - 0x1c, 0xfc, 0x75, 0x7e, 0xf0, 0xf5, 0x71, 0xaf, 0xe2, 0xfd, 0xb3, 0x02, 0xeb, 0x79, 0x94, 0xdf, - 0xdf, 0xb3, 0xb3, 0x1e, 0xac, 0xcc, 0xf1, 0xe0, 0x23, 0x68, 0x5e, 0x4d, 0xa9, 0x50, 0x5c, 0xa5, - 0xd5, 0x35, 0x5b, 0x93, 0x0f, 0xa1, 0x83, 0x19, 0x98, 0x9c, 0xa1, 0xdb, 0x38, 0x8b, 0x6c, 0xdc, - 0x97, 0x41, 0xf2, 0x6d, 0xd1, 0x96, 0x35, 0x6d, 0xcb, 0x2f, 0x97, 0xd9, 0xb2, 0x70, 0x93, 0xdd, - 0xc2, 0xef, 0x65, 0xd6, 0xac, 0xcf, 0xb1, 0xe6, 0x53, 0x58, 0x9f, 0xd9, 0x81, 0x00, 0xd4, 0x5f, - 0x1c, 0xf8, 0x5f, 0x1f, 0xbf, 0xcb, 0x9e, 0x7f, 0xa9, 0x41, 0xe7, 0x90, 0x26, 0x0c, 0xbf, 0xc4, - 0x58, 0xf3, 0x3d, 0x68, 0x86, 0x43, 0xca, 0x05, 0xe6, 0x26, 0x5a, 0x92, 0xf8, 0x0d, 0xbd, 0x3e, - 0x89, 0xee, 0x18, 0xba, 0xb2, 0x30, 0x85, 0x56, 0x17, 0xa6, 0x50, 0x75, 0x61, 0x0a, 0xd5, 0x4a, - 0x29, 0xf4, 0x08, 0xd2, 0xf2, 0x70, 0x34, 0x53, 0x2e, 0x8e, 0xee, 0xa4, 0x57, 0xe3, 0x1e, 0xe9, - 0xd5, 0x9c, 0x93, 0x5e, 0x04, 0xaa, 0x09, 0x1d, 0x29, 0x9d, 0x01, 0x55, 0x5f, 0xff, 0x26, 0xaf, - 0x8a, 0xee, 0x04, 0xed, 0xce, 0xcf, 0x17, 0xb9, 0xb3, 0x64, 0xc8, 0xdd, 0x7b, 0xb9, 0xb1, 0x7d, - 0xd7, 0x8d, 0xe4, 0x87, 0xd0, 0x4a, 0xf8, 0x40, 0x50, 0x35, 0x95, 0x69, 0x6b, 0xca, 0x01, 0xef, - 0xbf, 0x0e, 0xb4, 0x72, 0xff, 0x76, 0xa0, 0xa5, 0xd3, 0x25, 0x38, 0xfc, 0xcd, 0xb7, 0xbd, 0x15, - 0xd2, 0x05, 0x30, 0xcb, 0xb3, 0xe3, 0xd3, 0xd3, 0x9e, 0x83, 0x6b, 0xe3, 0x7e, 0x2d, 0xaf, 0x90, - 0x75, 0x68, 0xdb, 0xb5, 0x26, 0xac, 0x12, 0x02, 0x5d, 0x8c, 0x89, 0x20, 0xdf, 0xa4, 0x4a, 0x1e, - 0xc0, 0x7a, 0x01, 0xd3, 0xc4, 0x5a, 0x06, 0x16, 0xb6, 0xab, 0x93, 0x4d, 0xe8, 0x15, 0x41, 0x4d, - 0x6d, 0xe0, 0x9e, 0x18, 0x5d, 0x85, 0x3d, 0x9b, 0xa8, 0x5e, 0xc0, 0x34, 0xb1, 0x95, 0x81, 0x85, - 0x3d, 0x01, 0xf7, 0x2c, 0x82, 0x9a, 0xda, 0xf6, 0xfe, 0x5a, 0x83, 0x16, 0x9a, 0x77, 0x69, 0x8c, - 0xce, 0x6b, 0x12, 0x95, 0xf9, 0x53, 0xcb, 0x13, 0xe8, 0x98, 0x56, 0x96, 0xf2, 0x6c, 0x59, 0xd7, - 0x60, 0x81, 0xa4, 0x4a, 0x24, 0x1b, 0xb8, 0xaa, 0x48, 0xda, 0x87, 0x87, 0x17, 0x8c, 0x05, 0x32, - 0x8d, 0xe4, 0x8c, 0x6c, 0x8a, 0xfd, 0x83, 0x62, 0x94, 0xa7, 0x3a, 0x1f, 0x41, 0xd7, 0xa4, 0x46, - 0x46, 0x36, 0xa1, 0xdd, 0x31, 0x68, 0x4a, 0xfb, 0x14, 0x88, 0xfd, 0x48, 0x6c, 0xbf, 0x01, 0x2d, - 0x46, 0x79, 0xcf, 0x7c, 0x29, 0x0a, 0x6c, 0x14, 0x7f, 0x0a, 0x44, 0xdd, 0x65, 0x9b, 0x78, 0xef, - 0xa9, 0x59, 0xb6, 0xee, 0xc3, 0xc8, 0xc6, 0x36, 0xdd, 0x4a, 0x13, 0xeb, 0x92, 0x49, 0xdb, 0xa4, - 0x55, 0x26, 0x34, 0xb5, 0xbb, 0xa9, 0x52, 0xe1, 0x17, 0xf0, 0x03, 0x9d, 0x9b, 0xa6, 0xd5, 0xe0, - 0xe8, 0x13, 0x24, 0x2c, 0x8c, 0x45, 0x94, 0xd8, 0x88, 0x7e, 0x98, 0x8b, 0x71, 0xf8, 0x39, 0x33, - 0xc2, 0x2c, 0xcb, 0x4c, 0x54, 0x9b, 0x2c, 0xdb, 0x81, 0x5e, 0xf1, 0x86, 0x11, 0x55, 0xd4, 0x8e, - 0x5b, 0xdd, 0xfc, 0x7e, 0x47, 0x54, 0x51, 0x64, 0xaa, 0x59, 0xa6, 0x19, 0xb6, 0xba, 0xaa, 0xcc, - 0xdc, 0x83, 0xcd, 0xec, 0x66, 0x45, 0xb6, 0x19, 0xb5, 0x36, 0xd2, 0x4b, 0x96, 0x14, 0xd4, 0x3c, - 0x05, 0x3b, 0x6e, 0xa9, 0x3b, 0x0a, 0xa5, 0x24, 0xdd, 0x98, 0x4d, 0xd2, 0x7f, 0x54, 0xa0, 0x66, - 0x42, 0xf5, 0x4b, 0xa8, 0xe9, 0xec, 0xd7, 0x71, 0xda, 0xde, 0xff, 0x68, 0x59, 0xfd, 0xd0, 0x5a, - 0xbe, 0xd1, 0x21, 0x1f, 0xc3, 0xba, 0x92, 0x34, 0x62, 0xc1, 0x84, 0x72, 0x19, 0x0c, 0x69, 0x32, - 0xb4, 0xb1, 0xdc, 0xd1, 0xf0, 0x4b, 0xca, 0xe5, 0x73, 0x9a, 0x0c, 0x31, 0x48, 0xcd, 0x1c, 0x90, - 0x7a, 0x7c, 0x75, 0xce, 0x70, 0x80, 0x95, 0x59, 0x51, 0x35, 0x35, 0x21, 0x4c, 0x7c, 0xbb, 0x42, - 0x5f, 0x16, 0x26, 0xf3, 0x40, 0xb2, 0xab, 0x29, 0x97, 0x6c, 0xcc, 0xb2, 0x59, 0xe5, 0x61, 0x3e, - 0xa5, 0xfb, 0xb9, 0x90, 0x7c, 0x08, 0xdd, 0xbc, 0xf2, 0x07, 0x3c, 0x48, 0x47, 0xb9, 0x72, 0x3f, - 0xf8, 0x00, 0x40, 0xdf, 0x25, 0x50, 0x58, 0x44, 0x1b, 0xba, 0xba, 0x16, 0xea, 0x21, 0xa6, 0x97, - 0xa9, 0x7d, 0xf6, 0x61, 0xd0, 0x9c, 0xd3, 0xd7, 0xce, 0x01, 0xcc, 0xf4, 0x7e, 0x22, 0x2e, 0x62, - 0x1c, 0x51, 0xed, 0xa8, 0x3f, 0x8c, 0x47, 0x91, 0xed, 0xf6, 0x60, 0xa0, 0xe7, 0xf1, 0x28, 0xc2, - 0xcc, 0x52, 0xb1, 0xa2, 0xa3, 0x20, 0x62, 0x93, 0x38, 0xe1, 0x2a, 0xc9, 0x8c, 0x86, 0xe8, 0x91, - 0x05, 0xbd, 0xdf, 0x3b, 0xb0, 0x75, 0x58, 0x78, 0x3d, 0x7d, 0xff, 0x47, 0xdc, 0xeb, 0xd1, 0xe6, - 0xfd, 0xcd, 0x81, 0xee, 0x59, 0x6e, 0x32, 0x3c, 0x7f, 0x0c, 0xef, 0x95, 0xf4, 0xd2, 0xb7, 0x0d, - 0x17, 0x17, 0xb1, 0xeb, 0x3c, 0x5e, 0xdd, 0x69, 0xef, 0xef, 0x2f, 0x0b, 0xa4, 0xbb, 0xd7, 0xf2, - 0xb7, 0xfa, 0xf3, 0xaf, 0x9b, 0x3d, 0x1b, 0x2b, 0xc5, 0x67, 0xe3, 0x13, 0xe8, 0x14, 0xfd, 0x1b, - 0xa5, 0x1f, 0x5f, 0x70, 0x6f, 0xe4, 0x8d, 0xa1, 0xab, 0x23, 0xf6, 0x15, 0xbe, 0x10, 0xf4, 0x66, - 0xa5, 0xe1, 0xde, 0x99, 0x19, 0xee, 0x7f, 0x05, 0x75, 0xfd, 0x96, 0x40, 0x7b, 0xe1, 0x2d, 0x3e, - 0x5e, 0x74, 0x8b, 0x7c, 0x63, 0xdf, 0x6a, 0x79, 0x7f, 0xaa, 0xc0, 0xda, 0x4b, 0xb4, 0x2d, 0x8f, - 0xcd, 0xa7, 0x6f, 0x41, 0x9d, 0x27, 0xa7, 0xb1, 0x18, 0xe8, 0xa3, 0x9a, 0xbe, 0x5d, 0x61, 0x1b, - 0xe8, 0x53, 0x71, 0x29, 0xa7, 0x13, 0x15, 0xde, 0xda, 0xd0, 0xb2, 0x6d, 0x20, 0xc7, 0x4d, 0xbb, - 0x5d, 0x34, 0xf6, 0xed, 0xc3, 0xe6, 0xc4, 0x1e, 0x87, 0x7e, 0x7f, 0x95, 0xf2, 0x4c, 0x13, 0x98, - 0x2b, 0x23, 0x5f, 0xc0, 0xd6, 0x9d, 0xd7, 0xd9, 0xb1, 0x50, 0x76, 0xaa, 0x69, 0xf9, 0xef, 0x90, - 0xe2, 0x55, 0x8c, 0x9b, 0x6d, 0x1e, 0xd9, 0x15, 0xd9, 0x06, 0x60, 0x48, 0x30, 0x03, 0x83, 0xa9, - 0xfc, 0x05, 0xc4, 0x93, 0x00, 0xb9, 0xa5, 0xfe, 0xbf, 0x7a, 0xf3, 0x13, 0x58, 0xc7, 0x92, 0x81, - 0xcf, 0xad, 0xb4, 0x92, 0x18, 0xa3, 0x75, 0x53, 0xd8, 0xd4, 0x12, 0x6f, 0x07, 0x40, 0x1f, 0x7e, - 0xca, 0xae, 0xd9, 0x88, 0xac, 0x81, 0x33, 0xb1, 0xae, 0x76, 0x26, 0xb8, 0xba, 0xb2, 0x6a, 0xce, - 0x95, 0xf7, 0x1d, 0x74, 0x8f, 0xed, 0xb9, 0x47, 0x31, 0x3e, 0xc7, 0xf1, 0x5d, 0x7b, 0xcd, 0x24, - 0xbf, 0xb8, 0xc5, 0x47, 0x70, 0x18, 0x0b, 0x25, 0x69, 0xa8, 0xac, 0xfa, 0x46, 0x26, 0xf9, 0xca, - 0x0a, 0x4a, 0xbd, 0xde, 0xec, 0x9a, 0xf6, 0x7a, 0xef, 0xcf, 0x15, 0xd8, 0x38, 0xe3, 0x03, 0xc1, - 0xa2, 0x73, 0x49, 0x45, 0x42, 0x43, 0xf4, 0x45, 0xd6, 0x63, 0x9c, 0x42, 0x8f, 0xc1, 0x66, 0x8b, - 0x44, 0x39, 0x33, 0x13, 0x74, 0x0c, 0x9a, 0x36, 0x5b, 0x02, 0x55, 0x5d, 0xf5, 0x4d, 0x18, 0xe8, - 0xdf, 0x8b, 0x5a, 0x5d, 0x75, 0x51, 0xab, 0x7b, 0x1f, 0x5a, 0x03, 0x9a, 0xd8, 0xd0, 0xb3, 0xff, - 0xba, 0x0c, 0x68, 0x62, 0x62, 0xee, 0x10, 0xea, 0x91, 0xb6, 0x86, 0xf6, 0x75, 0x7b, 0xff, 0xa7, - 0x8b, 0xdc, 0x54, 0xb6, 0x9f, 0x6f, 0x35, 0xcb, 0x1d, 0xa8, 0x31, 0xd3, 0x81, 0x0e, 0x87, 0x7f, - 0x7f, 0xb3, 0xed, 0xbc, 0x7e, 0xb3, 0xed, 0xfc, 0xe7, 0xcd, 0xb6, 0xf3, 0xc7, 0xb7, 0xdb, 0x2b, - 0xaf, 0xdf, 0x6e, 0xaf, 0xfc, 0xfb, 0xed, 0xf6, 0xca, 0x77, 0xbf, 0x1e, 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, + // 1833 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x6f, 0xdb, 0xc8, + 0x19, 0x37, 0xf5, 0x8a, 0xf4, 0xf9, 0x11, 0xed, 0xd4, 0x71, 0xb4, 0xce, 0xae, 0xad, 0x55, 0xbb, + 0x0b, 0xc7, 0xc0, 0xca, 0xdd, 0xf4, 0xd0, 0xa2, 0xe8, 0x61, 0xd7, 0x91, 0x8d, 0x2a, 0x6b, 0xc7, + 0x5e, 0x4a, 0x8b, 0xbe, 0xb0, 0x65, 0x47, 0xe4, 0x58, 0x9a, 0x9a, 0xe4, 0x28, 0xe4, 0xd0, 0xb1, + 0xd1, 0x3f, 0xa0, 0xd8, 0x5b, 0x6f, 0xbd, 0x16, 0x28, 0xfa, 0x57, 0xf4, 0x5a, 0x14, 0xe9, 0x6d, + 0x0f, 0x05, 0x5a, 0x14, 0x45, 0x50, 0x24, 0x87, 0xf6, 0xd0, 0x4b, 0xff, 0x83, 0x62, 0x1e, 0xa4, + 0x48, 0x3b, 0x56, 0x12, 0x4a, 0x01, 0xda, 0x93, 0xc8, 0x79, 0xfc, 0x3e, 0x7e, 0x8f, 0xdf, 0x6f, + 0xbe, 0x81, 0xe0, 0x2e, 0xf5, 0x7f, 0x4e, 0x6c, 0x4e, 0xcf, 0xc8, 0x0e, 0x39, 0xb7, 0x47, 0xd8, + 0x1f, 0x92, 0x9d, 0xb3, 0x8f, 0x06, 0x84, 0xe3, 0x8f, 0x92, 0x81, 0xf6, 0x38, 0x60, 0x9c, 0xa1, + 0xf5, 0x64, 0x69, 0x3b, 0x99, 0xd1, 0x4b, 0xd7, 0x57, 0x87, 0x6c, 0xc8, 0xe4, 0xb2, 0x1d, 0xf1, + 0xa4, 0x76, 0xac, 0x6f, 0xd8, 0x2c, 0xf4, 0x58, 0xb8, 0x33, 0xc0, 0xe1, 0x04, 0xd5, 0x66, 0xd4, + 0x57, 0xf3, 0xad, 0x7f, 0x57, 0xa1, 0x72, 0x8c, 0x03, 0xec, 0x85, 0x88, 0xc0, 0x66, 0x38, 0x66, + 0xdc, 0xf2, 0x70, 0x70, 0x4a, 0xb8, 0x45, 0xfd, 0x90, 0x63, 0x9f, 0x5b, 0x2e, 0x0d, 0x39, 0xf5, + 0x87, 0xd6, 0x09, 0x21, 0x0d, 0xa3, 0x69, 0x6c, 0x2d, 0xde, 0x7b, 0xbb, 0xad, 0x40, 0xdb, 0x02, + 0x34, 0xb6, 0xdf, 0xbe, 0xcf, 0xa8, 0xbf, 0x5b, 0x7a, 0xf2, 0x74, 0x73, 0xc1, 0xbc, 0x23, 0x70, + 0x0e, 0x25, 0x4c, 0x57, 0xa1, 0x1c, 0x28, 0x90, 0x7d, 0x42, 0xd0, 0x23, 0x78, 0xdf, 0x21, 0x01, + 0x3d, 0xc3, 0xc2, 0x8d, 0x69, 0xc6, 0x0a, 0xaf, 0x66, 0xec, 0xbd, 0x09, 0xda, 0x75, 0x26, 0x5d, + 0xb8, 0xe3, 0x90, 0x13, 0x1c, 0xb9, 0xdc, 0xd2, 0x1e, 0x9e, 0x92, 0x40, 0xd8, 0xb0, 0x02, 0xcc, + 0x49, 0xa3, 0xd8, 0x34, 0xb6, 0x6a, 0xbb, 0x6d, 0x81, 0xf6, 0xb7, 0xa7, 0x9b, 0x1f, 0x0c, 0x29, + 0x1f, 0x45, 0x83, 0xb6, 0xcd, 0xbc, 0x1d, 0x1d, 0x3c, 0xf5, 0xf3, 0x61, 0xe8, 0x9c, 0xee, 0xf0, + 0x8b, 0x31, 0x09, 0xdb, 0x1d, 0x62, 0x9b, 0xb7, 0x35, 0x64, 0x4f, 0xfa, 0x7a, 0x4a, 0x82, 0x7d, + 0x42, 0x4c, 0xcc, 0xaf, 0x5a, 0xe3, 0x59, 0x6b, 0xa5, 0x99, 0xad, 0xf5, 0xd3, 0xd6, 0xce, 0xe1, + 0xbd, 0xd8, 0x5a, 0x26, 0xac, 0x19, 0x9b, 0xe5, 0x5c, 0x36, 0xdf, 0xd5, 0xc0, 0x9d, 0x54, 0x80, + 0x5f, 0x6a, 0xf9, 0x92, 0xb7, 0x95, 0x39, 0x59, 0xce, 0xf8, 0xcc, 0xe0, 0x9d, 0xd8, 0x32, 0xf5, + 0x29, 0xa7, 0xd8, 0x15, 0x75, 0x34, 0xa4, 0xbe, 0xb0, 0x49, 0x59, 0xe3, 0x46, 0x2e, 0xa3, 0x6f, + 0x6b, 0xcc, 0xae, 0x82, 0x3c, 0x94, 0x88, 0xa6, 0x00, 0x44, 0x8f, 0xa1, 0x19, 0x1b, 0xf4, 0x30, + 0xf5, 0x39, 0xf1, 0xb1, 0x6f, 0x93, 0xac, 0xd1, 0xea, 0x4c, 0x9e, 0x1e, 0x4e, 0x60, 0xd3, 0x86, + 0xbf, 0x03, 0x8d, 0xd8, 0xf0, 0x49, 0xe4, 0x3b, 0x82, 0x1a, 0x62, 0x5d, 0x70, 0x86, 0xdd, 0x46, + 0xad, 0x69, 0x6c, 0x15, 0xcd, 0x35, 0x3d, 0xbf, 0xaf, 0xa6, 0xbb, 0x7a, 0x16, 0xdd, 0x85, 0x7a, + 0xbc, 0xc3, 0x8b, 0x5c, 0x4e, 0xc7, 0x2e, 0x69, 0x80, 0xdc, 0x71, 0x53, 0x8f, 0x1f, 0xea, 0x61, + 0x64, 0xc3, 0x5a, 0x40, 0x5c, 0x7c, 0xa1, 0xf3, 0x16, 0x8e, 0x70, 0xa0, 0xb3, 0xb7, 0x98, 0xcb, + 0xa7, 0xaf, 0x69, 0xb4, 0x7d, 0x42, 0x7a, 0x02, 0x4b, 0xe4, 0xec, 0xbb, 0xa5, 0x7f, 0xfd, 0x66, + 0xd3, 0x68, 0x7d, 0x59, 0x83, 0x7a, 0xe7, 0x12, 0x5f, 0xd1, 0x1a, 0x54, 0x38, 0xb5, 0x4f, 0x49, + 0x20, 0xf5, 0xa5, 0x66, 0xea, 0x37, 0x31, 0xce, 0x02, 0x6c, 0xbb, 0x4a, 0x0a, 0x6a, 0xa6, 0x7e, + 0x43, 0x9b, 0xb0, 0xf8, 0x28, 0x62, 0x9c, 0x58, 0x0e, 0xf1, 0x99, 0xa7, 0xe8, 0x6b, 0x82, 0x1c, + 0xea, 0x88, 0x11, 0x74, 0x07, 0x6a, 0xb1, 0xae, 0x38, 0x8a, 0x6f, 0x66, 0x55, 0x0d, 0x74, 0x1d, + 0x74, 0x08, 0x20, 0x9e, 0xad, 0x71, 0x40, 0xed, 0xbc, 0xcc, 0x90, 0xf0, 0xc7, 0x02, 0x00, 0xfd, + 0x0c, 0x56, 0x5f, 0x58, 0x83, 0xf9, 0x0a, 0x1f, 0xd1, 0xab, 0xc5, 0x37, 0x82, 0xc6, 0xb5, 0x45, + 0x97, 0xaf, 0xd2, 0xd7, 0xbc, 0x17, 0x57, 0x5b, 0x1f, 0x56, 0x2e, 0x09, 0x47, 0xbe, 0xa2, 0x5e, + 0xf2, 0xd2, 0x6c, 0xed, 0xc3, 0xca, 0x25, 0x51, 0xa8, 0xe5, 0x43, 0xe5, 0x69, 0xd4, 0xeb, 0x8b, + 0x16, 0xe6, 0x56, 0xb4, 0x88, 0xc0, 0xed, 0x11, 0x8b, 0x02, 0xf7, 0x22, 0x61, 0x9f, 0xb0, 0x60, + 0xd9, 0x78, 0x9c, 0x93, 0x1a, 0xab, 0x0a, 0x4e, 0x93, 0x55, 0xd8, 0xb8, 0x8f, 0xc7, 0xa2, 0x86, + 0xb4, 0x19, 0x49, 0x6e, 0x12, 0x72, 0xe5, 0xc9, 0x52, 0xbe, 0x1a, 0x52, 0x58, 0x5d, 0x0d, 0x25, + 0x1d, 0xd9, 0x87, 0x26, 0x39, 0x1f, 0xd3, 0xe0, 0xc2, 0x62, 0x81, 0xe5, 0x93, 0xf3, 0x89, 0x9c, + 0x70, 0xea, 0x91, 0x90, 0x63, 0x6f, 0xdc, 0x58, 0x96, 0xea, 0xf0, 0x8e, 0x5a, 0x77, 0x14, 0x3c, + 0x24, 0xe7, 0xb1, 0xa8, 0xf4, 0xe3, 0x35, 0x69, 0x55, 0x49, 0x74, 0x68, 0x25, 0xa3, 0x2a, 0x89, + 0x00, 0x7d, 0x01, 0xc8, 0x8e, 0xbc, 0xc8, 0x55, 0xc7, 0x82, 0x9e, 0x6d, 0xdc, 0xcc, 0xe5, 0xd2, + 0x5b, 0x13, 0x24, 0xfd, 0x49, 0xe8, 0x63, 0xa8, 0x84, 0x1c, 0xf3, 0x28, 0x6c, 0xd4, 0x9b, 0xc6, + 0xd6, 0xca, 0xbd, 0xad, 0xf6, 0xf5, 0xbd, 0x51, 0x5b, 0x09, 0x4d, 0x4f, 0xae, 0x37, 0xf5, 0xbe, + 0xd6, 0x9f, 0x8b, 0x00, 0xbd, 0xa4, 0x51, 0xb9, 0x56, 0x85, 0xde, 0x05, 0x10, 0xad, 0x87, 0x16, + 0x1b, 0xa5, 0x44, 0x35, 0x31, 0xa2, 0xb4, 0xe6, 0xa5, 0x62, 0x74, 0x95, 0x54, 0xa5, 0x37, 0x42, + 0xaa, 0xf2, 0x1b, 0x25, 0x55, 0x65, 0x7e, 0xa4, 0xca, 0xa8, 0xf3, 0x8d, 0x4b, 0xea, 0x3c, 0x49, + 0x6b, 0x35, 0x67, 0x5a, 0x7f, 0x6f, 0xc0, 0x8d, 0x0e, 0x19, 0xb3, 0x90, 0x72, 0xf4, 0x13, 0x78, + 0x0b, 0x9f, 0x61, 0xea, 0xe2, 0x81, 0x4b, 0xac, 0x01, 0x76, 0x85, 0xe0, 0xa9, 0xf4, 0xbe, 0xb6, + 0x2b, 0xf5, 0x04, 0x68, 0x57, 0xe1, 0xa0, 0x1e, 0x2c, 0x73, 0xc6, 0xb1, 0x9b, 0x00, 0x17, 0x72, + 0x66, 0x40, 0x80, 0x68, 0xd0, 0xd6, 0x3f, 0x0d, 0xa8, 0x1d, 0x05, 0x0e, 0x09, 0xba, 0xfe, 0x09, + 0x43, 0x5f, 0x87, 0xe5, 0x30, 0x1a, 0x60, 0xdb, 0x66, 0x91, 0x2f, 0xc3, 0xa5, 0x4a, 0x73, 0x69, + 0x32, 0xd8, 0x75, 0xc4, 0x22, 0x59, 0x04, 0xc4, 0xa6, 0x63, 0x4a, 0x7c, 0xae, 0x6b, 0x74, 0xe9, + 0x84, 0x10, 0x33, 0x1e, 0x43, 0x1d, 0x28, 0xab, 0x03, 0x2f, 0x5f, 0xb3, 0xab, 0x36, 0xa3, 0x07, + 0x50, 0x7d, 0x14, 0x61, 0x9f, 0x53, 0x7e, 0x91, 0xb3, 0x8a, 0x93, 0xfd, 0xad, 0xdf, 0x16, 0xa0, + 0x26, 0xe8, 0x27, 0xbd, 0xcd, 0x16, 0x85, 0x71, 0xa9, 0x28, 0x1e, 0x00, 0x30, 0xb1, 0xca, 0xa2, + 0xfe, 0x09, 0xd3, 0xf7, 0x82, 0xf7, 0xa7, 0x15, 0x46, 0x12, 0x41, 0x7d, 0x47, 0xa8, 0xb1, 0x24, + 0xa4, 0x9d, 0x18, 0x4b, 0x7c, 0x93, 0x8c, 0xc6, 0xca, 0x2b, 0x60, 0xf5, 0x2f, 0xc6, 0x44, 0xa3, + 0x88, 0x47, 0x99, 0xfb, 0x80, 0x0e, 0x87, 0x24, 0xd0, 0x7d, 0x44, 0x4e, 0x4e, 0x6b, 0x10, 0xd5, + 0x4a, 0x20, 0x28, 0x85, 0xd8, 0xe5, 0x92, 0xc9, 0xcb, 0xa6, 0x7c, 0x6e, 0xfd, 0xa5, 0x00, 0x2b, + 0x22, 0x4a, 0x07, 0xd4, 0xa3, 0x3a, 0x54, 0xd9, 0x68, 0x18, 0x73, 0x8c, 0x46, 0x21, 0x67, 0x34, + 0x1e, 0x40, 0xf5, 0x84, 0xba, 0x92, 0x1c, 0x39, 0xeb, 0x2b, 0xd9, 0xff, 0xc6, 0x22, 0x3b, 0xc2, + 0xe1, 0x48, 0x46, 0x76, 0xc9, 0x94, 0xcf, 0xad, 0x3f, 0x18, 0x70, 0x73, 0x22, 0xff, 0xf3, 0x0f, + 0xed, 0x67, 0xb0, 0xa4, 0x85, 0xc1, 0x1a, 0x31, 0xd7, 0xc9, 0xa9, 0x0e, 0x8b, 0x1a, 0xe3, 0xfb, + 0xcc, 0x75, 0x12, 0x37, 0xd4, 0x21, 0xa3, 0xdc, 0xf8, 0x4f, 0x01, 0x6e, 0x4e, 0x3a, 0xea, 0xff, + 0x4b, 0x32, 0xed, 0x43, 0x45, 0x35, 0xb5, 0x39, 0x73, 0xad, 0x77, 0x5f, 0x2d, 0x9d, 0xf2, 0x1c, + 0x49, 0x59, 0x49, 0x91, 0xf2, 0x77, 0x45, 0x58, 0x9d, 0xc4, 0xfc, 0x7f, 0x9a, 0x9a, 0x93, 0xd8, + 0x16, 0x67, 0x8a, 0x6d, 0x9a, 0xe2, 0xa5, 0x79, 0x53, 0xbc, 0x3c, 0x47, 0x8a, 0x57, 0x52, 0x14, + 0x7f, 0x62, 0xc0, 0xad, 0xcb, 0xb7, 0xcd, 0xf9, 0x27, 0xea, 0x08, 0x16, 0xf5, 0x9d, 0x6c, 0x06, + 0x9e, 0x83, 0x82, 0xb8, 0x96, 0xe6, 0x7f, 0x2c, 0x42, 0xf5, 0x58, 0xf4, 0x34, 0x94, 0xf9, 0xa2, + 0x55, 0xa5, 0xe1, 0x01, 0xf3, 0x87, 0xf2, 0xcb, 0xab, 0xa6, 0x7e, 0xcb, 0x1c, 0xcf, 0x85, 0xd9, + 0x8e, 0x67, 0xe1, 0x15, 0xf1, 0x79, 0x70, 0x61, 0xcd, 0xd2, 0x36, 0x80, 0x84, 0x50, 0x09, 0x9a, + 0x23, 0xcb, 0x45, 0x9c, 0xad, 0xc4, 0xd3, 0x9c, 0xd5, 0x23, 0x40, 0x3e, 0x8b, 0xbd, 0x1d, 0x41, + 0xe3, 0xea, 0x65, 0xc5, 0x92, 0x5f, 0x9f, 0xb3, 0xf5, 0x5d, 0xbb, 0x72, 0x65, 0xd9, 0x13, 0x68, + 0xad, 0x2e, 0xac, 0xa6, 0x0a, 0xb1, 0xeb, 0x3b, 0xd4, 0xc6, 0x9c, 0xbd, 0x44, 0xb3, 0x57, 0xa1, + 0x4c, 0xc3, 0xdd, 0x48, 0x65, 0xb5, 0x6a, 0xaa, 0x97, 0xd6, 0xaf, 0x0b, 0x50, 0xed, 0x07, 0xd8, + 0x21, 0x07, 0x2c, 0x9b, 0x7b, 0x63, 0xc6, 0xdc, 0x27, 0xcd, 0x62, 0x61, 0x96, 0x66, 0xf1, 0x4a, + 0xf3, 0x5a, 0x7c, 0x41, 0xf3, 0xfa, 0x31, 0x14, 0x4f, 0x48, 0x5e, 0x49, 0x11, 0x5b, 0x33, 0x67, + 0x7b, 0xcc, 0x96, 0xbf, 0x1b, 0x70, 0x7b, 0xef, 0x8c, 0xf8, 0x7c, 0x17, 0x73, 0x7b, 0x24, 0x4e, + 0xf9, 0xbd, 0x73, 0x62, 0x47, 0x92, 0x3c, 0x53, 0x03, 0x7d, 0x4b, 0x30, 0xcb, 0x1a, 0x5c, 0x8a, + 0x34, 0x3a, 0x82, 0x65, 0x12, 0x03, 0xf4, 0x27, 0x47, 0xdd, 0xdd, 0x69, 0x8a, 0xb1, 0x97, 0xde, + 0x60, 0x66, 0xf7, 0xa3, 0xef, 0x41, 0x85, 0x8b, 0xcc, 0x85, 0x8d, 0x52, 0xb3, 0xb8, 0xb5, 0x78, + 0xef, 0x1b, 0xd3, 0x90, 0xe2, 0x1c, 0x9b, 0x7a, 0x4f, 0xeb, 0x4f, 0x06, 0x20, 0xe9, 0xde, 0x43, + 0xf2, 0x38, 0x69, 0xa1, 0xc3, 0xe9, 0x9e, 0x75, 0x01, 0x06, 0x91, 0xb8, 0xfe, 0x8b, 0xa5, 0x8d, + 0x82, 0xb4, 0xba, 0x3d, 0xcd, 0x6a, 0xb6, 0xeb, 0x34, 0x6b, 0x83, 0xe8, 0x42, 0xdb, 0xf9, 0x14, + 0x16, 0x43, 0xe2, 0xba, 0x31, 0x56, 0xf1, 0xb5, 0xb1, 0x40, 0x6c, 0x57, 0x60, 0xad, 0x5f, 0xc0, + 0xaa, 0x74, 0xe5, 0xbe, 0xe8, 0x72, 0xdc, 0x57, 0xbc, 0x10, 0xec, 0x43, 0x59, 0x1a, 0xd7, 0xed, + 0xcb, 0x6b, 0xd8, 0xd6, 0xf2, 0xad, 0xb6, 0xb7, 0xbe, 0x80, 0x5b, 0xd2, 0xf8, 0xa4, 0x0f, 0xfc, + 0x7c, 0xec, 0x88, 0x3b, 0x6a, 0x47, 0x8a, 0xd5, 0x29, 0xe1, 0xfa, 0x6c, 0xf8, 0xe0, 0x65, 0x16, + 0xd4, 0x6e, 0x8d, 0xae, 0xf7, 0xb6, 0xbe, 0x34, 0xb4, 0x73, 0xfa, 0x3e, 0xfa, 0x03, 0xca, 0x47, + 0x4e, 0x80, 0x1f, 0x0b, 0x01, 0x0f, 0x59, 0x14, 0xc4, 0x97, 0x51, 0x53, 0xbf, 0xa1, 0x26, 0x2c, + 0x3a, 0x24, 0xe4, 0xd4, 0xc7, 0xa2, 0x52, 0xf4, 0x45, 0x2e, 0x3d, 0x84, 0xbe, 0x0d, 0x15, 0xec, + 0x09, 0xee, 0xc8, 0x12, 0x7c, 0x85, 0xbf, 0x47, 0xf4, 0xf2, 0xd6, 0x2f, 0x0d, 0x58, 0x4f, 0x05, + 0xfa, 0xb5, 0x5a, 0xc6, 0x83, 0x6c, 0xb8, 0xbf, 0x39, 0x2d, 0x18, 0x2f, 0xea, 0x8b, 0x32, 0x41, + 0xdf, 0xde, 0x83, 0xa5, 0xf4, 0xc5, 0x1d, 0x01, 0x54, 0x3e, 0x91, 0x60, 0xf5, 0x05, 0xf1, 0x7c, + 0x8c, 0xa3, 0x90, 0x38, 0x75, 0x03, 0x2d, 0x43, 0xad, 0x17, 0x85, 0x63, 0xe2, 0x3b, 0xc4, 0xa9, + 0x17, 0xd0, 0x0a, 0x40, 0x87, 0x78, 0xcc, 0xa5, 0xe1, 0x88, 0x38, 0xf5, 0xe2, 0xf6, 0x0f, 0xf5, + 0x45, 0x59, 0xf2, 0xe9, 0x06, 0x14, 0x77, 0x3f, 0xff, 0x51, 0x7d, 0x01, 0x55, 0xa1, 0xd4, 0xdb, + 0x3b, 0x38, 0xa8, 0x1b, 0x68, 0x09, 0xaa, 0xbd, 0xfe, 0xd1, 0xb1, 0x25, 0xc6, 0x0b, 0x12, 0x4c, + 0xbc, 0xc9, 0xc9, 0xa2, 0x98, 0xec, 0x7f, 0xf2, 0xe9, 0x9e, 0x9c, 0x2c, 0x89, 0x49, 0xf9, 0x26, + 0x27, 0xcb, 0xdb, 0x4d, 0xa8, 0x75, 0x68, 0x20, 0x1c, 0x64, 0xbe, 0x00, 0x14, 0x67, 0x6b, 0x7d, + 0x01, 0xd5, 0xa0, 0xdc, 0x1b, 0xb1, 0x80, 0xd7, 0x8d, 0xed, 0x9f, 0xc2, 0x72, 0x86, 0xde, 0xe2, + 0xbb, 0x95, 0x4f, 0xf5, 0x05, 0x81, 0x26, 0x5d, 0xdf, 0xa7, 0xae, 0x5b, 0x37, 0xd0, 0x3a, 0xac, + 0xc9, 0xd7, 0x43, 0x21, 0x45, 0xa6, 0x4c, 0xe5, 0x50, 0x7e, 0x78, 0xbd, 0x80, 0xd6, 0x00, 0x4d, + 0xe6, 0x1e, 0x92, 0xc7, 0x6a, 0xbc, 0xb8, 0x3b, 0x7a, 0xf2, 0x6c, 0xc3, 0xf8, 0xea, 0xd9, 0x86, + 0xf1, 0x8f, 0x67, 0x1b, 0xc6, 0xaf, 0x9e, 0x6f, 0x2c, 0x7c, 0xf5, 0x7c, 0x63, 0xe1, 0xaf, 0xcf, + 0x37, 0x16, 0x7e, 0xfc, 0x30, 0x25, 0x8d, 0xdd, 0x38, 0x0b, 0x07, 0x78, 0x10, 0xee, 0x24, 0x39, + 0xf9, 0xd0, 0x66, 0x01, 0x49, 0xbf, 0x8e, 0x30, 0xf5, 0x77, 0x3c, 0xe6, 0x44, 0x2e, 0x09, 0x27, + 0x7f, 0x31, 0x4a, 0x19, 0x1d, 0x54, 0xe4, 0xdf, 0x80, 0xdf, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x37, 0x10, 0x2f, 0xc2, 0x85, 0x1c, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.SpotMarketInstantListingFee.Equal(&that1.SpotMarketInstantListingFee) { + return false + } + if !this.DerivativeMarketInstantListingFee.Equal(&that1.DerivativeMarketInstantListingFee) { + return false + } + if !this.DefaultSpotMakerFeeRate.Equal(that1.DefaultSpotMakerFeeRate) { + return false + } + if !this.DefaultSpotTakerFeeRate.Equal(that1.DefaultSpotTakerFeeRate) { + return false + } + if !this.DefaultDerivativeMakerFeeRate.Equal(that1.DefaultDerivativeMakerFeeRate) { + return false + } + if !this.DefaultDerivativeTakerFeeRate.Equal(that1.DefaultDerivativeTakerFeeRate) { + return false + } + if !this.DefaultInitialMarginRatio.Equal(that1.DefaultInitialMarginRatio) { + return false + } + if !this.DefaultMaintenanceMarginRatio.Equal(that1.DefaultMaintenanceMarginRatio) { + return false + } + if this.DefaultFundingInterval != that1.DefaultFundingInterval { + return false + } + if this.FundingMultiple != that1.FundingMultiple { + return false + } + if !this.RelayerFeeShareRate.Equal(that1.RelayerFeeShareRate) { + return false + } + return true } - -func (m *DerivativeMarket) Marshal() (dAtA []byte, err error) { +func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1819,116 +1643,257 @@ func (m *DerivativeMarket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DerivativeMarket) MarshalTo(dAtA []byte) (int, error) { +func (m *Params) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.CumulativeFunding) > 0 { - i -= len(m.CumulativeFunding) - copy(dAtA[i:], m.CumulativeFunding) - i = encodeVarintExchange(dAtA, i, uint64(len(m.CumulativeFunding))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + { + size := m.RelayerFeeShareRate.Size() + i -= size + if _, err := m.RelayerFeeShareRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.FundingInterval) > 0 { - i -= len(m.FundingInterval) - copy(dAtA[i:], m.FundingInterval) - i = encodeVarintExchange(dAtA, i, uint64(len(m.FundingInterval))) + i-- + dAtA[i] = 0x5a + if m.FundingMultiple != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.FundingMultiple)) i-- - dAtA[i] = 0x7a + dAtA[i] = 0x50 } - if len(m.NextFundingTimestamp) > 0 { - i -= len(m.NextFundingTimestamp) - copy(dAtA[i:], m.NextFundingTimestamp) - i = encodeVarintExchange(dAtA, i, uint64(len(m.NextFundingTimestamp))) + if m.DefaultFundingInterval != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.DefaultFundingInterval)) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x48 } - 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] = 0x6a + { + size := m.DefaultMaintenanceMarginRatio.Size() + i -= size + if _, err := m.DefaultMaintenanceMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.DefaultInitialMarginRatio.Size() + i -= size + if _, err := m.DefaultInitialMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.DefaultDerivativeTakerFeeRate.Size() + i -= size + if _, err := m.DefaultDerivativeTakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.DefaultDerivativeMakerFeeRate.Size() + i -= size + if _, err := m.DefaultDerivativeMakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.DefaultSpotTakerFeeRate.Size() + i -= size + if _, err := m.DefaultSpotTakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.DefaultSpotMakerFeeRate.Size() + i -= size + if _, err := m.DefaultSpotMakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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] = 0x62 + i-- + dAtA[i] = 0x1a + { + size, err := m.DerivativeMarketInstantListingFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.MaintenanceMarginRatio) > 0 { - i -= len(m.MaintenanceMarginRatio) - copy(dAtA[i:], m.MaintenanceMarginRatio) - i = encodeVarintExchange(dAtA, i, uint64(len(m.MaintenanceMarginRatio))) - i-- - dAtA[i] = 0x5a + i-- + dAtA[i] = 0x12 + { + size, err := m.SpotMarketInstantListingFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.InitialMarginRatio) > 0 { - i -= len(m.InitialMarginRatio) - copy(dAtA[i:], m.InitialMarginRatio) - i = encodeVarintExchange(dAtA, i, uint64(len(m.InitialMarginRatio))) - i-- - dAtA[i] = 0x52 + i-- + dAtA[i] = 0xa + return len(dAtA) - i, 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 } - if len(m.IndexPrice) > 0 { - i -= len(m.IndexPrice) - copy(dAtA[i:], m.IndexPrice) - i = encodeVarintExchange(dAtA, i, uint64(len(m.IndexPrice))) + return dAtA[:n], nil +} + +func (m *DerivativeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x4a - } - if len(m.PriceFactor) > 0 { - i -= len(m.PriceFactor) - copy(dAtA[i:], m.PriceFactor) - i = encodeVarintExchange(dAtA, i, uint64(len(m.PriceFactor))) + dAtA[i] = 0x1 i-- - dAtA[i] = 0x42 + dAtA[i] = 0x80 + } + { + size := m.CumulativeFunding.Size() + i -= size + if _, err := m.CumulativeFunding.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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] = 0x7a + if m.FundingInterval != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.FundingInterval)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x70 } - if m.Enabled { + if m.ExpiryOrNextFundingTimestamp != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.ExpiryOrNextFundingTimestamp)) i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x68 + } + { + size := m.HourlyInterestRate.Size() + i -= size + if _, err := m.HourlyInterestRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err } - i-- - dAtA[i] = 0x30 + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + { + size := m.HourlyFundingRateCap.Size() + i -= size + if _, err := m.HourlyFundingRateCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size := m.RelayerFeeShareRate.Size() + i -= size + if _, err := m.RelayerFeeShareRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + { + size := m.TakerFeeRate.Size() + i -= size + if _, err := m.TakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size := m.MakerFeeRate.Size() + i -= size + if _, err := m.MakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.MaintenanceMarginRatio.Size() + i -= size + if _, err := m.MaintenanceMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.InitialMarginRatio.Size() + i -= size + if _, err := m.InitialMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.MarkPrice.Size() + i -= size + if _, err := m.MarkPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a 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] = 0x2a - } - if len(m.Nonce) > 0 { - i -= len(m.Nonce) - copy(dAtA[i:], 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 = encodeVarintExchange(dAtA, i, uint64(len(m.BaseCurrency))) + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintExchange(dAtA, i, uint64(len(m.QuoteDenom))) i-- dAtA[i] = 0x1a } @@ -1969,55 +1934,59 @@ func (m *SpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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 { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if m.Status != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x40 } 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.MakerTxFee) > 0 { - i -= len(m.MakerTxFee) - copy(dAtA[i:], m.MakerTxFee) - i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerTxFee))) - i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a } - if len(m.QuoteAsset) > 0 { - i -= len(m.QuoteAsset) - copy(dAtA[i:], m.QuoteAsset) - i = encodeVarintExchange(dAtA, i, uint64(len(m.QuoteAsset))) + { + size := m.RelayerFeeShareRate.Size() + i -= size + if _, err := m.RelayerFeeShareRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.TakerFeeRate.Size() + i -= size + if _, err := m.TakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.MakerFeeRate.Size() + i -= size + if _, err := m.MakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintExchange(dAtA, i, uint64(len(m.QuoteDenom))) i-- dAtA[i] = 0x1a } - if len(m.BaseAsset) > 0 { - i -= len(m.BaseAsset) - copy(dAtA[i:], m.BaseAsset) - i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseAsset))) + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseDenom))) i-- dAtA[i] = 0x12 } @@ -2031,7 +2000,7 @@ func (m *SpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SpotLimitOrder) Marshal() (dAtA []byte, err error) { +func (m *Deposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2041,84 +2010,97 @@ func (m *SpotLimitOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SpotLimitOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *Deposit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SpotLimitOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Deposit) 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] = 0x52 - } - if m.OrderType != 0 { - i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) - i-- - dAtA[i] = 0x48 - } - if m.CreationBlockHeight != 0 { - i = encodeVarintExchange(dAtA, i, uint64(m.CreationBlockHeight)) - i-- - dAtA[i] = 0x40 - } - 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] = 0x3a - } - 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] = 0x32 + { + size := m.TotalBalance.Size() + i -= size + if _, err := m.TotalBalance.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.AvailableBalance.Size() + i -= size + if _, err := m.AvailableBalance.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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] = 0x2a + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *OrderInfo) 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.Expiry != 0 { - i = encodeVarintExchange(dAtA, i, uint64(m.Expiry)) - i-- - dAtA[i] = 0x20 + return dAtA[:n], nil +} + +func (m *OrderInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OrderInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Quantity.Size() + i -= size + if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } + 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] = 0x1a - } - 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] = 0x12 } - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) + 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 *SpotMarketOrder) Marshal() (dAtA []byte, err error) { +func (m *SpotOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2128,60 +2110,57 @@ func (m *SpotMarketOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SpotMarketOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *SpotOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SpotMarketOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpotOrder) 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)) + if m.Salt != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Salt)) 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 + { + size := m.TriggerPrice.Size() + i -= size + if _, err := m.TriggerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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] = 0x22 + if m.OrderType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - 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 + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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 len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarketId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BaseSpotOrder) 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]) @@ -2191,96 +2170,62 @@ func (m *BaseSpotOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BaseSpotOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *SpotLimitOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BaseSpotOrder) 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 = encodeVarintExchange(dAtA, i, uint64(len(m.Signature))) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Hash))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x2a } - 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 + { + size := m.TriggerPrice.Size() + i -= size + if _, err := m.TriggerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.Fillable.Size() + i -= size + if _, err := m.Fillable.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a 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 + dAtA[i] = 0x10 } - if m.ChainId != 0 { - i = encodeVarintExchange(dAtA, i, uint64((uint64(m.ChainId)<<1)^uint64((m.ChainId>>63)))) - i-- - dAtA[i] = 0x8 + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *BaseOrder) Marshal() (dAtA []byte, err error) { +func (m *SpotMarketOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2290,141 +2235,117 @@ func (m *BaseOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BaseOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *SpotMarketOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BaseOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpotMarketOrder) 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))) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Hash))) i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a + dAtA[i] = 0x1a } - 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 + { + size := m.BalanceHold.Size() + i -= size + if _, err := m.BalanceHold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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 + i-- + dAtA[i] = 0x12 + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.SenderAddress) > 0 { - i -= len(m.SenderAddress) - copy(dAtA[i:], m.SenderAddress) - i = encodeVarintExchange(dAtA, i, uint64(len(m.SenderAddress))) - i-- - dAtA[i] = 0x32 + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DerivativeOrder) 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 len(m.FeeRecipientAddress) > 0 { - i -= len(m.FeeRecipientAddress) - copy(dAtA[i:], m.FeeRecipientAddress) - i = encodeVarintExchange(dAtA, i, uint64(len(m.FeeRecipientAddress))) + return dAtA[:n], nil +} + +func (m *DerivativeOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Salt != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Salt)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x30 } - if len(m.TakerAddress) > 0 { - i -= len(m.TakerAddress) - copy(dAtA[i:], m.TakerAddress) - i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerAddress))) - i-- - dAtA[i] = 0x22 + { + size := m.TriggerPrice.Size() + i -= size + if _, err := m.TriggerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Margin.Size() + i -= size + if _, err := m.Margin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerAddress))) + i-- + dAtA[i] = 0x22 + if m.OrderType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - 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] = 0x12 + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if m.ChainId != 0 { - i = encodeVarintExchange(dAtA, i, uint64((uint64(m.ChainId)<<1)^uint64((m.ChainId>>63)))) + i-- + dAtA[i] = 0x12 + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *Order) Marshal() (dAtA []byte, err error) { +func (m *DerivativeLimitOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2434,77 +2355,122 @@ func (m *Order) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Order) MarshalTo(dAtA []byte) (int, error) { +func (m *DerivativeLimitOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DerivativeLimitOrder) 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))) + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Hash))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x32 + } + { + size := m.TriggerPrice.Size() + i -= size + if _, err := m.TriggerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Fillable.Size() + i -= size + if _, err := m.Fillable.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.Margin.Size() + i -= size + if _, err := m.Margin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if m.OrderType != 0 { 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 = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x32 + dAtA[i] = 0x10 } - if len(m.IndexPriceRequirement) > 0 { - i -= len(m.IndexPriceRequirement) - copy(dAtA[i:], m.IndexPriceRequirement) - i = encodeVarintExchange(dAtA, i, uint64(len(m.IndexPriceRequirement))) - i-- - dAtA[i] = 0x2a + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if m.Status != 0 { - i = encodeVarintExchange(dAtA, i, uint64((uint64(m.Status)<<1)^uint64((m.Status>>63)))) - i-- - dAtA[i] = 0x20 + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DerivativeMarketOrder) 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 len(m.FilledAmount) > 0 { - i -= len(m.FilledAmount) - copy(dAtA[i:], m.FilledAmount) - i = encodeVarintExchange(dAtA, i, uint64(len(m.FilledAmount))) + return dAtA[:n], nil +} + +func (m *DerivativeMarketOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DerivativeMarketOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Hash))) i-- dAtA[i] = 0x1a } - if len(m.TradePairHash) > 0 { - i -= len(m.TradePairHash) - copy(dAtA[i:], m.TradePairHash) - i = encodeVarintExchange(dAtA, i, uint64(len(m.TradePairHash))) - i-- - dAtA[i] = 0x12 + { + size := m.MarginHold.Size() + i -= size + if _, err := m.MarginHold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintExchange(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + { + size, err := m.OrderInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MarginInfo) Marshal() (dAtA []byte, err error) { +func (m *Position) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2514,34 +2480,80 @@ func (m *MarginInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MarginInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *Position) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MarginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Position) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.TotalDeposits) > 0 { - i -= len(m.TotalDeposits) - copy(dAtA[i:], m.TotalDeposits) - i = encodeVarintExchange(dAtA, i, uint64(len(m.TotalDeposits))) - i-- - dAtA[i] = 0x12 + { + size := m.CumulativeFundingEntry.Size() + i -= size + if _, err := m.CumulativeFundingEntry.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.HoldQuantity.Size() + i -= size + if _, err := m.HoldQuantity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Margin.Size() + i -= size + if _, err := m.Margin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.EntryPrice.Size() + i -= size + if _, err := m.EntryPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.Quantity.Size() + i -= size + if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) } - if len(m.MarginHold) > 0 { - i -= len(m.MarginHold) - copy(dAtA[i:], m.MarginHold) - i = encodeVarintExchange(dAtA, i, uint64(len(m.MarginHold))) + i-- + dAtA[i] = 0x12 + if m.IsLong { i-- - dAtA[i] = 0xa + if m.IsLong { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *BaseCurrencyMarginInfo) Marshal() (dAtA []byte, err error) { +func (m *MarketOrderIndicator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2551,41 +2563,37 @@ func (m *BaseCurrencyMarginInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BaseCurrencyMarginInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *MarketOrderIndicator) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BaseCurrencyMarginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MarketOrderIndicator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.BaseCurrency) > 0 { - i -= len(m.BaseCurrency) - copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseCurrency))) + if m.IsBuy { i-- - dAtA[i] = 0x1a - } - if len(m.TotalDeposits) > 0 { - i -= len(m.TotalDeposits) - copy(dAtA[i:], m.TotalDeposits) - i = encodeVarintExchange(dAtA, i, uint64(len(m.TotalDeposits))) + if m.IsBuy { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.MarginHold) > 0 { - i -= len(m.MarginHold) - copy(dAtA[i:], m.MarginHold) - i = encodeVarintExchange(dAtA, i, uint64(len(m.MarginHold))) + 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] = 0xa } return len(dAtA) - i, nil } -func (m *SubaccountInfo) Marshal() (dAtA []byte, err error) { +func (m *TradeLog) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2595,16 +2603,33 @@ func (m *SubaccountInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SubaccountInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *TradeLog) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SubaccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TradeLog) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x2a + } + { + size := m.Fee.Size() + i -= size + if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 if len(m.SubaccountId) > 0 { i -= len(m.SubaccountId) copy(dAtA[i:], m.SubaccountId) @@ -2612,31 +2637,30 @@ func (m *SubaccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Nonce) > 0 { - i -= len(m.Nonce) - copy(dAtA[i:], m.Nonce) - i = encodeVarintExchange(dAtA, i, uint64(len(m.Nonce))) - i-- - dAtA[i] = 0x12 - } - if len(m.BaseCurrencyMarginInfo) > 0 { - for iNdEx := len(m.BaseCurrencyMarginInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BaseCurrencyMarginInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintExchange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Quantity.Size() + i -= size + if _, err := m.Quantity.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *OrderQuoteInfo) Marshal() (dAtA []byte, err error) { +func (m *EventBatchSpotExecution) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2646,20 +2670,20 @@ func (m *OrderQuoteInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OrderQuoteInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *EventBatchSpotExecution) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OrderQuoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventBatchSpotExecution) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Quotes) > 0 { - for iNdEx := len(m.Quotes) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Trades) > 0 { + for iNdEx := len(m.Trades) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Quotes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Trades[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2667,8 +2691,23 @@ func (m *OrderQuoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 + } + } + if m.ExecutionType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.ExecutionType)) + i-- + dAtA[i] = 0x18 + } + if m.IsBuy { + i-- + if m.IsBuy { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x10 } if len(m.MarketId) > 0 { i -= len(m.MarketId) @@ -2680,7 +2719,7 @@ func (m *OrderQuoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PositionInfo) Marshal() (dAtA []byte, err error) { +func (m *EventNewSpotOrders) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2690,72 +2729,55 @@ func (m *PositionInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PositionInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *EventNewSpotOrders) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PositionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventNewSpotOrders) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.EntryPrice) > 0 { - i -= len(m.EntryPrice) - copy(dAtA[i:], 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 = 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 = 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 = 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 = 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 = encodeVarintExchange(dAtA, i, uint64(len(m.BankruptcyPrice))) - i-- - dAtA[i] = 0x12 + if len(m.SellOrders) > 0 { + for iNdEx := len(m.SellOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SellOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - if m.IsLong { - i-- - if m.IsLong { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.BuyOrders) > 0 { + for iNdEx := len(m.BuyOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BuyOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } + } + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *OrderQuote) Marshal() (dAtA []byte, err error) { +func (m *EventCancelSpotOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2765,39 +2787,37 @@ func (m *OrderQuote) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OrderQuote) MarshalTo(dAtA []byte) (int, error) { +func (m *EventCancelSpotOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OrderQuote) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventCancelSpotOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.FillableAmount) > 0 { - i -= len(m.FillableAmount) - copy(dAtA[i:], m.FillableAmount) - i = encodeVarintExchange(dAtA, i, uint64(len(m.FillableAmount))) - i-- - dAtA[i] = 0x12 - } - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintExchange(dAtA, i, uint64(size)) + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + 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] = 0xa } return len(dAtA) - i, nil } -func (m *PriceLevel) Marshal() (dAtA []byte, err error) { +func (m *EventSpotMarketUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2807,34 +2827,30 @@ func (m *PriceLevel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PriceLevel) MarshalTo(dAtA []byte) (int, error) { +func (m *EventSpotMarketUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriceLevel) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventSpotMarketUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Q) > 0 { - i -= len(m.Q) - copy(dAtA[i:], 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 = encodeVarintExchange(dAtA, i, uint64(len(m.P))) - i-- - dAtA[i] = 0xa + { + size, err := m.Market.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ExchangeDomain) Marshal() (dAtA []byte, err error) { +func (m *EventDepositWithdraw) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2844,34 +2860,44 @@ func (m *ExchangeDomain) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExchangeDomain) MarshalTo(dAtA []byte) (int, error) { +func (m *EventDepositWithdraw) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExchangeDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventDepositWithdraw) 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 = encodeVarintExchange(dAtA, i, uint64(len(m.ChainId))) + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Destination) > 0 { + i -= len(m.Destination) + copy(dAtA[i:], m.Destination) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Destination))) i-- dAtA[i] = 0x12 } - if len(m.VerifyingContract) > 0 { - i -= len(m.VerifyingContract) - copy(dAtA[i:], m.VerifyingContract) - i = encodeVarintExchange(dAtA, i, uint64(len(m.VerifyingContract))) + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Source))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *SignedTransaction) Marshal() (dAtA []byte, err error) { +func (m *EventCancelDerivativeOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2881,67 +2907,30 @@ func (m *SignedTransaction) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SignedTransaction) MarshalTo(dAtA []byte) (int, error) { +func (m *EventCancelDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SignedTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventCancelDerivativeOrder) 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] = 0x3a - } - if m.Domain != nil { - { - size, err := m.Domain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintExchange(dAtA, i, uint64(size)) + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x32 - } - 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] = 0x2a - } - 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] = 0x22 - } - 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] = 0x1a - } - 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 + i -= size + i = encodeVarintExchange(dAtA, i, uint64(size)) } - 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] = 0x12 + 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] = 0xa } @@ -2959,6 +2948,39 @@ func encodeVarintExchange(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SpotMarketInstantListingFee.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DerivativeMarketInstantListingFee.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultSpotMakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultSpotTakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultDerivativeMakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultDerivativeTakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultInitialMarginRatio.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.DefaultMaintenanceMarginRatio.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.DefaultFundingInterval != 0 { + n += 1 + sovExchange(uint64(m.DefaultFundingInterval)) + } + if m.FundingMultiple != 0 { + n += 1 + sovExchange(uint64(m.FundingMultiple)) + } + l = m.RelayerFeeShareRate.Size() + n += 1 + l + sovExchange(uint64(l)) + return n +} + func (m *DerivativeMarket) Size() (n int) { if m == nil { return 0 @@ -2973,11 +2995,7 @@ func (m *DerivativeMarket) Size() (n int) { 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) + l = len(m.QuoteDenom) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } @@ -2985,48 +3003,32 @@ func (m *DerivativeMarket) Size() (n int) { 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)) - } - l = len(m.PriceFactor) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.IndexPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.InitialMarginRatio) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.MaintenanceMarginRatio) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - 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)) + l = m.MarkPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.InitialMarginRatio.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.MaintenanceMarginRatio.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.MakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.RelayerFeeShareRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.HourlyFundingRateCap.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.HourlyInterestRate.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.ExpiryOrNextFundingTimestamp != 0 { + n += 1 + sovExchange(uint64(m.ExpiryOrNextFundingTimestamp)) + } + if m.FundingInterval != 0 { + n += 1 + sovExchange(uint64(m.FundingInterval)) + } + l = m.CumulativeFunding.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.Status != 0 { + n += 2 + sovExchange(uint64(m.Status)) } return n } @@ -3041,47 +3043,50 @@ func (m *SpotMarket) Size() (n int) { if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.BaseAsset) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.QuoteAsset) + l = len(m.BaseDenom) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.MakerTxFee) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TakerTxFee) + l = len(m.QuoteDenom) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } + l = m.MakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TakerFeeRate.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.RelayerFeeShareRate.Size() + n += 1 + l + sovExchange(uint64(l)) 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)) + if m.Status != 0 { + n += 1 + sovExchange(uint64(m.Status)) } return n } -func (m *SpotLimitOrder) Size() (n int) { +func (m *Deposit) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + l = m.AvailableBalance.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TotalBalance.Size() + n += 1 + l + sovExchange(uint64(l)) + return n +} + +func (m *OrderInfo) Size() (n int) { + if m == nil { + return 0 } - l = len(m.Sender) + var l int + _ = l + l = len(m.SubaccountId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } @@ -3089,296 +3094,203 @@ func (m *SpotLimitOrder) Size() (n int) { if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - if m.Expiry != 0 { - n += 1 + sovExchange(uint64(m.Expiry)) - } - l = len(m.SupplyAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.DemandAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + l = m.Price.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.Quantity.Size() + n += 1 + l + sovExchange(uint64(l)) + return n +} + +func (m *SpotOrder) Size() (n int) { + if m == nil { + return 0 } - l = len(m.FilledAmount) + var l int + _ = l + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - if m.CreationBlockHeight != 0 { - n += 1 + sovExchange(uint64(m.CreationBlockHeight)) - } + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) if m.OrderType != 0 { n += 1 + sovExchange(uint64(m.OrderType)) } - l = len(m.TriggerPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + l = m.TriggerPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.Salt != 0 { + n += 1 + sovExchange(uint64(m.Salt)) } return n } -func (m *SpotMarketOrder) Size() (n int) { +func (m *SpotLimitOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FeeRecipient) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Quantity) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FundsSupplied) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) if m.OrderType != 0 { n += 1 + sovExchange(uint64(m.OrderType)) } - l = len(m.TriggerPrice) + l = m.Fillable.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TriggerPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.Hash) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *BaseSpotOrder) Size() (n int) { +func (m *SpotMarketOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ChainId != 0 { - n += 1 + sozExchange(uint64(m.ChainId)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FeeRecipient) + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.BalanceHold.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.Hash) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - if m.Expiry != 0 { - n += 1 + sovExchange(uint64(m.Expiry)) - } - l = len(m.MarketID) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.SupplyAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + return n +} + +func (m *DerivativeOrder) Size() (n int) { + if m == nil { + return 0 } - l = len(m.DemandAmount) + var l int + _ = l + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - if m.Salt != 0 { - n += 1 + sovExchange(uint64(m.Salt)) - } + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) if m.OrderType != 0 { n += 1 + sovExchange(uint64(m.OrderType)) } - l = len(m.TriggerPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + l = m.Margin.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TriggerPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.Salt != 0 { + n += 1 + sovExchange(uint64(m.Salt)) } return n } -func (m *BaseOrder) Size() (n int) { +func (m *DerivativeLimitOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ChainId != 0 { - n += 1 + sozExchange(uint64(m.ChainId)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TakerAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FeeRecipientAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.SenderAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.MakerAssetAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TakerAssetAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.MakerFee) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.ExpirationTimeSeconds) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Salt) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.MakerAssetData) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TakerAssetData) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) + if m.OrderType != 0 { + n += 1 + sovExchange(uint64(m.OrderType)) } - l = len(m.MakerFeeAssetData) + l = m.Margin.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.Fillable.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.TriggerPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.Hash) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.TakerFeeAssetData) - if l > 0 { - n += 2 + l + sovExchange(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 2 + l + sovExchange(uint64(l)) - } return n } -func (m *Order) Size() (n int) { +func (m *DerivativeMarketOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TradePairHash) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FilledAmount) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - if m.Status != 0 { - n += 1 + sozExchange(uint64(m.Status)) - } - l = len(m.IndexPriceRequirement) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - if m.OrderType != 0 { - n += 1 + sovExchange(uint64(m.OrderType)) - } - l = len(m.TriggerPrice) + l = m.OrderInfo.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.MarginHold.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.Hash) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *MarginInfo) Size() (n int) { +func (m *Position) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.MarginHold) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TotalDeposits) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + if m.IsLong { + n += 2 } + l = m.Quantity.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.EntryPrice.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.Margin.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.HoldQuantity.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.CumulativeFundingEntry.Size() + n += 1 + l + sovExchange(uint64(l)) return n } -func (m *BaseCurrencyMarginInfo) Size() (n int) { +func (m *MarketOrderIndicator) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.MarginHold) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.TotalDeposits) + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.BaseCurrency) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + if m.IsBuy { + n += 2 } return n } -func (m *SubaccountInfo) Size() (n int) { +func (m *TradeLog) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.BaseCurrencyMarginInfo) > 0 { - for _, e := range m.BaseCurrencyMarginInfo { - l = e.Size() - n += 1 + l + sovExchange(uint64(l)) - } - } - l = len(m.Nonce) + l = m.Quantity.Size() + n += 1 + l + sovExchange(uint64(l)) + l = m.Price.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.SubaccountId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.SubaccountId) + l = m.Fee.Size() + n += 1 + l + sovExchange(uint64(l)) + l = len(m.Hash) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *OrderQuoteInfo) Size() (n int) { +func (m *EventBatchSpotExecution) Size() (n int) { if m == nil { return 0 } @@ -3388,8 +3300,14 @@ func (m *OrderQuoteInfo) Size() (n int) { if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - if len(m.Quotes) > 0 { - for _, e := range m.Quotes { + if m.IsBuy { + n += 2 + } + if m.ExecutionType != 0 { + n += 1 + sovExchange(uint64(m.ExecutionType)) + } + if len(m.Trades) > 0 { + for _, e := range m.Trades { l = e.Size() n += 1 + l + sovExchange(uint64(l)) } @@ -3397,127 +3315,88 @@ func (m *OrderQuoteInfo) Size() (n int) { return n } -func (m *PositionInfo) Size() (n int) { +func (m *EventNewSpotOrders) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.IsLong { - n += 2 - } - l = len(m.BankruptcyPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Quantity) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.PositionHoldQuantity) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.CumulativeFundingEntry) + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.Margin) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + if len(m.BuyOrders) > 0 { + for _, e := range m.BuyOrders { + l = e.Size() + n += 1 + l + sovExchange(uint64(l)) + } } - l = len(m.EntryPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) + if len(m.SellOrders) > 0 { + for _, e := range m.SellOrders { + l = e.Size() + n += 1 + l + sovExchange(uint64(l)) + } } return n } -func (m *OrderQuote) Size() (n int) { +func (m *EventCancelSpotOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.FillableAmount) + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } + l = m.Order.Size() + n += 1 + l + sovExchange(uint64(l)) return n } -func (m *PriceLevel) Size() (n int) { +func (m *EventSpotMarketUpdate) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.P) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Q) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } + l = m.Market.Size() + n += 1 + l + sovExchange(uint64(l)) return n } -func (m *ExchangeDomain) Size() (n int) { +func (m *EventDepositWithdraw) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.VerifyingContract) + l = len(m.Source) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } - l = len(m.ChainId) + l = len(m.Destination) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } + l = m.Amount.Size() + n += 1 + l + sovExchange(uint64(l)) return n } -func (m *SignedTransaction) Size() (n int) { +func (m *EventCancelDerivativeOrder) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Salt) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.SignerAddress) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.ExpirationTimeSeconds) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.GasPrice) - if l > 0 { - n += 1 + l + sovExchange(uint64(l)) - } - if m.Domain != nil { - l = m.Domain.Size() - n += 1 + l + sovExchange(uint64(l)) - } - l = len(m.Signature) + l = len(m.MarketId) if l > 0 { n += 1 + l + sovExchange(uint64(l)) } + l = m.Order.Size() + n += 1 + l + sovExchange(uint64(l)) return n } @@ -3527,7 +3406,7 @@ func sovExchange(x uint64) (n int) { func sozExchange(x uint64) (n int) { return sovExchange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { +func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3549,146 +3428,18 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { } 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 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.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 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.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 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.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 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.Nonce = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SpotMarketInstantListingFee", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -3698,49 +3449,30 @@ func (m *DerivativeMarket) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } 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 ErrIntOverflowExchange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.SpotMarketInstantListingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Enabled = bool(v != 0) - case 7: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DerivativeMarketInstantListingFee", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -3750,27 +3482,28 @@ func (m *DerivativeMarket) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + if err := m.DerivativeMarketInstantListingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceFactor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultSpotMakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3798,11 +3531,13 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PriceFactor = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultSpotMakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 9: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultSpotTakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3830,11 +3565,13 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IndexPrice = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultSpotTakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 10: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialMarginRatio", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultDerivativeMakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3862,11 +3599,13 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitialMarginRatio = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultDerivativeMakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 11: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaintenanceMarginRatio", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultDerivativeTakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3894,11 +3633,13 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MaintenanceMarginRatio = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultDerivativeTakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 12: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerTxFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultInitialMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3926,11 +3667,13 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerTxFee = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultInitialMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 13: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerTxFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultMaintenanceMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3958,13 +3701,15 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerTxFee = string(dAtA[iNdEx:postIndex]) + if err := m.DefaultMaintenanceMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextFundingTimestamp", wireType) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultFundingInterval", wireType) } - var stringLen uint64 + m.DefaultFundingInterval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -3974,29 +3719,16 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.DefaultFundingInterval |= int64(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.NextFundingTimestamp = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FundingInterval", wireType) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FundingMultiple", wireType) } - var stringLen uint64 + m.FundingMultiple = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -4006,27 +3738,14 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.FundingMultiple |= int64(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.FundingInterval = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFunding", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFeeShareRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4054,7 +3773,9 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CumulativeFunding = string(dAtA[iNdEx:postIndex]) + if err := m.RelayerFeeShareRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4077,7 +3798,7 @@ func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *SpotMarket) Unmarshal(dAtA []byte) error { +func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4100,10 +3821,10 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SpotMarket: wiretype end group for non-group") + return fmt.Errorf("proto: DerivativeMarket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SpotMarket: 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: @@ -4140,7 +3861,7 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAsset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4168,11 +3889,11 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseAsset = 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 QuoteAsset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4200,11 +3921,11 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.QuoteAsset = string(dAtA[iNdEx:postIndex]) + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerTxFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4232,11 +3953,11 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerTxFee = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerTxFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarkPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4264,11 +3985,13 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerTxFee = string(dAtA[iNdEx:postIndex]) + if err := m.MarkPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex 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 InitialMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4296,31 +4019,13 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MarketId = string(dAtA[iNdEx:postIndex]) + if err := m.InitialMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } 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 ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaintenanceMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4348,93 +4053,13 @@ func (m *SpotMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipExchange(dAtA[iNdEx:]) - if err != nil { + if err := m.MaintenanceMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); 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 *SpotLimitOrder) 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: SpotLimitOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - 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 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 2: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4462,11 +4087,13 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + if err := m.MakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipient", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4494,30 +4121,13 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeRecipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 - } + if err := m.TakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - case 5: + iNdEx = postIndex + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplyAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFeeShareRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4545,11 +4155,13 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplyAmount = string(dAtA[iNdEx:postIndex]) + if err := m.RelayerFeeShareRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 6: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DemandAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HourlyFundingRateCap", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4577,11 +4189,13 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DemandAmount = string(dAtA[iNdEx:postIndex]) + if err := m.HourlyFundingRateCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FilledAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HourlyInterestRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4609,13 +4223,15 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FilledAmount = string(dAtA[iNdEx:postIndex]) + if err := m.HourlyInterestRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 13: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationBlockHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryOrNextFundingTimestamp", wireType) } - m.CreationBlockHeight = 0 + m.ExpiryOrNextFundingTimestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -4625,16 +4241,16 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CreationBlockHeight |= int64(b&0x7F) << shift + m.ExpiryOrNextFundingTimestamp |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 9: + case 14: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FundingInterval", wireType) } - m.OrderType = 0 + m.FundingInterval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -4644,14 +4260,14 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.OrderType |= SpotLimitOrder_LimitOrderType(b&0x7F) << shift + m.FundingInterval |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 10: + case 15: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFunding", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4679,8 +4295,29 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TriggerPrice = string(dAtA[iNdEx:postIndex]) + if err := m.CumulativeFunding.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= MarketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipExchange(dAtA[iNdEx:]) @@ -4702,7 +4339,7 @@ func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { +func (m *SpotMarket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4725,15 +4362,15 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SpotMarketOrder: wiretype end group for non-group") + return fmt.Errorf("proto: SpotMarket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SpotMarketOrder: illegal tag %d (wire type %d)", fieldNum, wire) + 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 SubaccountID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4761,11 +4398,11 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountID = 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 FeeRecipient", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4793,11 +4430,11 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeRecipient = string(dAtA[iNdEx:postIndex]) + m.BaseDenom = 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 QuoteDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4825,11 +4462,11 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Quantity = string(dAtA[iNdEx:postIndex]) + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FundsSupplied", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4857,13 +4494,15 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FundsSupplied = string(dAtA[iNdEx:postIndex]) + if err := m.MakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeRate", wireType) } - m.OrderType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -4873,14 +4512,63 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.OrderType |= SpotMarketOrder_MarketOrderType(b&0x7F) << shift + 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 + } + if err := m.TakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFeeShareRate", 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 + } + if err := m.RelayerFeeShareRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4908,8 +4596,27 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TriggerPrice = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= MarketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipExchange(dAtA[iNdEx:]) @@ -4931,7 +4638,7 @@ func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { +func (m *Deposit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4954,36 +4661,15 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BaseSpotOrder: wiretype end group for non-group") + return fmt.Errorf("proto: Deposit: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BaseSpotOrder: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Deposit: 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) + return fmt.Errorf("proto: wrong wireType = %d for field AvailableBalance", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5011,11 +4697,13 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountID = string(dAtA[iNdEx:postIndex]) + if err := m.AvailableBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + 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 TotalBalance", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5043,94 +4731,63 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { 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 FeeRecipient", 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 err := m.TotalBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthExchange + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExchange(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExchange } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.FeeRecipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 MarketID", 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 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OrderInfo) 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 postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.MarketID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: + 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: OrderInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OrderInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplyAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5158,11 +4815,11 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplyAmount = string(dAtA[iNdEx:postIndex]) + m.SubaccountId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DemandAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5190,49 +4847,11 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DemandAmount = string(dAtA[iNdEx:postIndex]) + m.FeeRecipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) - } - 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 - } - } - case 10: - 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 |= BaseSpotOrder_OrderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5260,11 +4879,13 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TriggerPrice = string(dAtA[iNdEx:postIndex]) + if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 12: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5292,7 +4913,9 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signature = string(dAtA[iNdEx:postIndex]) + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -5315,7 +4938,7 @@ func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *BaseOrder) Unmarshal(dAtA []byte) error { +func (m *SpotOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5338,17 +4961,17 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BaseOrder: wiretype end group for non-group") + return fmt.Errorf("proto: SpotOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BaseOrder: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SpotOrder: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } - var v uint64 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5358,18 +4981,29 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.ChainId = int64(v) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OrderInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5379,27 +5013,47 @@ func (m *BaseOrder) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: + 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 |= OrderType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5427,13 +5081,15 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAddress = string(dAtA[iNdEx:postIndex]) + if err := m.TriggerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAddress", wireType) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) } - var stringLen uint64 + m.Salt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5443,29 +5099,66 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Salt |= uint32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthExchange + default: + iNdEx = preIndex + skippy, err := skipExchange(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExchange } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.TakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpotLimitOrder) 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: SpotLimitOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 FeeRecipientAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OrderInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5475,27 +5168,47 @@ func (m *BaseOrder) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeRecipientAddress = string(dAtA[iNdEx:postIndex]) + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 6: + case 2: + 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 |= OrderType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SenderAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fillable", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5523,11 +5236,13 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SenderAddress = string(dAtA[iNdEx:postIndex]) + if err := m.Fillable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5555,13 +5270,15 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetAmount = string(dAtA[iNdEx:postIndex]) + if err := m.TriggerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5571,29 +5288,81 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetAmount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + 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 *SpotMarketOrder) 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: SpotMarketOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 MakerFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OrderInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5603,27 +5372,28 @@ func (m *BaseOrder) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerFee = string(dAtA[iNdEx:postIndex]) + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 10: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BalanceHold", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5651,11 +5421,13 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerFee = string(dAtA[iNdEx:postIndex]) + if err := m.BalanceHold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 11: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimeSeconds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5683,11 +5455,61 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExpirationTimeSeconds = string(dAtA[iNdEx:postIndex]) + m.Hash = 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 *DerivativeOrder) 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: DerivativeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DerivativeOrder: 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 MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5715,13 +5537,13 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Salt = string(dAtA[iNdEx:postIndex]) + m.MarketId = 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 OrderInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5731,29 +5553,30 @@ func (m *BaseOrder) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } - var stringLen uint64 + m.OrderType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5763,27 +5586,14 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.OrderType |= OrderType(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.TakerAssetData = 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 Margin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5811,11 +5621,13 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerFeeAssetData = string(dAtA[iNdEx:postIndex]) + if err := m.Margin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } 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 TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5843,13 +5655,15 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerFeeAssetData = string(dAtA[iNdEx:postIndex]) + if err := m.TriggerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) } - var stringLen uint64 + m.Salt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5859,24 +5673,11 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Salt |= uint32(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.Signature = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipExchange(dAtA[iNdEx:]) @@ -5898,7 +5699,7 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *Order) Unmarshal(dAtA []byte) error { +func (m *DerivativeLimitOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5921,15 +5722,15 @@ 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: DerivativeLimitOrder: 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: DerivativeLimitOrder: 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 OrderInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5956,18 +5757,15 @@ func (m *Order) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradePairHash", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } - var stringLen uint64 + m.OrderType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -5977,27 +5775,14 @@ func (m *Order) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.OrderType |= OrderType(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.TradePairHash = 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 Margin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6025,32 +5810,13 @@ func (m *Order) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FilledAmount = string(dAtA[iNdEx:postIndex]) + if err := m.Margin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex 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 IndexPriceRequirement", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fillable", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6078,11 +5844,13 @@ func (m *Order) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IndexPriceRequirement = string(dAtA[iNdEx:postIndex]) + if err := m.Fillable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 6: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6110,32 +5878,15 @@ func (m *Order) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - 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 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.TriggerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - case 8: + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6145,23 +5896,25 @@ func (m *Order) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TriggerPrice = string(dAtA[iNdEx:postIndex]) + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -6184,7 +5937,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { } return nil } -func (m *MarginInfo) Unmarshal(dAtA []byte) error { +func (m *DerivativeMarketOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6203,17 +5956,50 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MarginInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DerivativeMarketOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DerivativeMarketOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OrderInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MarginHold", wireType) } @@ -6243,11 +6029,13 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MarginHold = string(dAtA[iNdEx:postIndex]) + if err := m.MarginHold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6275,7 +6063,7 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TotalDeposits = string(dAtA[iNdEx:postIndex]) + m.Hash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6298,7 +6086,7 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { +func (m *Position) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6321,17 +6109,17 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BaseCurrencyMarginInfo: wiretype end group for non-group") + return fmt.Errorf("proto: Position: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BaseCurrencyMarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Position: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLong", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6341,27 +6129,15 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(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.MarginHold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.IsLong = bool(v != 0) 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 Quantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6389,11 +6165,13 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TotalDeposits = string(dAtA[iNdEx:postIndex]) + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrency", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EntryPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6421,63 +6199,15 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseCurrency = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipExchange(dAtA[iNdEx:]) - if err != nil { + if err := m.EntryPrice.Unmarshal(dAtA[iNdEx:postIndex]); 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 *SubaccountInfo) 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: SubaccountInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubaccountInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + 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 Margin", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6487,29 +6217,29 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { 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 { + if err := m.Margin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HoldQuantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6537,11 +6267,13 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Nonce = string(dAtA[iNdEx:postIndex]) + if err := m.HoldQuantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + 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 CumulativeFundingEntry", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6569,7 +6301,9 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountId = string(dAtA[iNdEx:postIndex]) + if err := m.CumulativeFundingEntry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6592,7 +6326,7 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { +func (m *MarketOrderIndicator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6615,10 +6349,10 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OrderQuoteInfo: wiretype end group for non-group") + return fmt.Errorf("proto: MarketOrderIndicator: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OrderQuoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MarketOrderIndicator: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6654,10 +6388,10 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quotes", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBuy", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6667,26 +6401,12 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthExchange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - 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 - } - iNdEx = postIndex + m.IsBuy = bool(v != 0) default: iNdEx = preIndex skippy, err := skipExchange(dAtA[iNdEx:]) @@ -6708,7 +6428,7 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *PositionInfo) Unmarshal(dAtA []byte) error { +func (m *TradeLog) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6731,17 +6451,17 @@ 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: TradeLog: 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: TradeLog: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6751,15 +6471,29 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.IsLong = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex 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 Price", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6787,11 +6521,13 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BankruptcyPrice = string(dAtA[iNdEx:postIndex]) + if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } 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 SubaccountId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6819,11 +6555,11 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Quantity = string(dAtA[iNdEx:postIndex]) + m.SubaccountId = 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 Fee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6851,11 +6587,95 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PositionHoldQuantity = string(dAtA[iNdEx:postIndex]) + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } 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 Hash", 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.Hash = 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 *EventBatchSpotExecution) 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: EventBatchSpotExecution: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBatchSpotExecution: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6883,13 +6703,33 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CumulativeFundingEntry = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Margin", wireType) + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBuy", 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.IsBuy = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionType", wireType) } - var stringLen uint64 + m.ExecutionType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6899,29 +6739,16 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.ExecutionType |= ExecutionType(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.Margin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EntryPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Trades", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -6931,23 +6758,25 @@ func (m *PositionInfo) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.EntryPrice = string(dAtA[iNdEx:postIndex]) + m.Trades = append(m.Trades, &TradeLog{}) + if err := m.Trades[len(m.Trades)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6970,7 +6799,7 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *OrderQuote) Unmarshal(dAtA []byte) error { +func (m *EventNewSpotOrders) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6993,15 +6822,47 @@ func (m *OrderQuote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OrderQuote: wiretype end group for non-group") + return fmt.Errorf("proto: EventNewSpotOrders: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OrderQuote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventNewSpotOrders: 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 MarketId", 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.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrders", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7028,18 +6889,16 @@ func (m *OrderQuote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.BuyOrders = append(m.BuyOrders, &SpotLimitOrder{}) + if err := m.BuyOrders[len(m.BuyOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FillableAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SellOrders", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -7049,23 +6908,25 @@ func (m *OrderQuote) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.FillableAmount = string(dAtA[iNdEx:postIndex]) + m.SellOrders = append(m.SellOrders, &SpotLimitOrder{}) + if err := m.SellOrders[len(m.SellOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -7088,7 +6949,7 @@ func (m *OrderQuote) Unmarshal(dAtA []byte) error { } return nil } -func (m *PriceLevel) Unmarshal(dAtA []byte) error { +func (m *EventCancelSpotOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7111,15 +6972,15 @@ func (m *PriceLevel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PriceLevel: wiretype end group for non-group") + return fmt.Errorf("proto: EventCancelSpotOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PriceLevel: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventCancelSpotOrder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field P", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7147,13 +7008,13 @@ func (m *PriceLevel) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.P = 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 Q", 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 ErrIntOverflowExchange @@ -7163,23 +7024,24 @@ func (m *PriceLevel) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Q = string(dAtA[iNdEx:postIndex]) + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -7202,7 +7064,7 @@ func (m *PriceLevel) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { +func (m *EventSpotMarketUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7225,17 +7087,17 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExchangeDomain: wiretype end group for non-group") + return fmt.Errorf("proto: EventSpotMarketUpdate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExchangeDomain: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventSpotMarketUpdate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VerifyingContract", 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 ErrIntOverflowExchange @@ -7245,55 +7107,24 @@ func (m *ExchangeDomain) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.VerifyingContract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", 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 + if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7316,7 +7147,7 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { } return nil } -func (m *SignedTransaction) Unmarshal(dAtA []byte) error { +func (m *EventDepositWithdraw) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7339,15 +7170,15 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignedTransaction: wiretype end group for non-group") + return fmt.Errorf("proto: EventDepositWithdraw: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignedTransaction: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventDepositWithdraw: 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 Source", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7375,11 +7206,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Salt = string(dAtA[iNdEx:postIndex]) + m.Source = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7407,13 +7238,13 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SignerAddress = string(dAtA[iNdEx:postIndex]) + m.Destination = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExchange @@ -7423,59 +7254,78 @@ func (m *SignedTransaction) 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 ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimeSeconds", wireType) + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - 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 - } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExchange(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExchange + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventCancelDerivativeOrder) 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 } - m.ExpirationTimeSeconds = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + 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: EventCancelDerivativeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCancelDerivativeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7503,11 +7353,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.GasPrice = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7534,45 +7384,10 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Domain == nil { - m.Domain = &ExchangeDomain{} - } - if err := m.Domain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", 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.Signature = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipExchange(dAtA[iNdEx:]) diff --git a/chain/exchange/types/genesis.go b/chain/exchange/types/genesis.go deleted file mode 100644 index 8bd2665a..00000000 --- a/chain/exchange/types/genesis.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -func NewGenesisState() GenesisState { - return GenesisState{} -} - -func (gs GenesisState) Validate() error { - // TODO: validate stuff in genesis - return nil -} - -func DefaultGenesisState() *GenesisState { - return &GenesisState{} -} diff --git a/chain/exchange/types/genesis.pb.go b/chain/exchange/types/genesis.pb.go deleted file mode 100644 index 68bab892..00000000 --- a/chain/exchange/types/genesis.pb.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/exchange/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "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 - -// GenesisState defines the evm module's genesis state. -type GenesisState struct { - // accounts is an array containing the genesis trade pairs - 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"` - // - Params Params `protobuf:"bytes,3,opt,name=params,proto3" json:"params"` -} - -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_c47ec6b98758ed05, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetSpotMarkets() []*SpotMarket { - if m != nil { - return m.SpotMarkets - } - return nil -} - -func (m *GenesisState) GetDerivativeMarkets() []*DerivativeMarket { - if m != nil { - return m.DerivativeMarkets - } - return nil -} - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "injective.exchange.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("injective/exchange/v1beta1/genesis.proto", fileDescriptor_c47ec6b98758ed05) -} - -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, 0xa0, 0xc5, 0xd8, 0x07, 0xc5, 0xc6, - 0x34, 0x82, 0x14, 0x24, 0x97, 0x24, 0xcb, 0x85, 0x12, 0x8e, 0x6b, 0x48, 0xb2, 0x25, 0x49, 0x43, - 0xba, 0xc7, 0x2d, 0x16, 0x03, 0x6b, 0x8d, 0x7b, 0xd4, 0x82, 0x66, 0x2c, 0x67, 0x49, 0x33, 0xcf, - 0xdd, 0x8f, 0x44, 0x24, 0x74, 0x49, 0x37, 0x55, 0xdd, 0x1d, 0x7d, 0x21, 0xbb, 0x7f, 0x59, 0xef, - 0xb5, 0x50, 0x4c, 0x81, 0x33, 0xb3, 0xfb, 0x32, 0x13, 0xea, 0x21, 0x61, 0xf9, 0x13, 0x28, 0x39, - 0x40, 0xc3, 0x8e, 0xd7, 0x9b, 0x1c, 0x92, 0xff, 0xb7, 0x25, 0x8b, 0x4c, 0xa8, 0x6b, 0x8d, 0xcf, - 0x7b, 0xd2, 0xd4, 0xd2, 0xb9, 0xb7, 0x9d, 0x10, 0x72, 0x5e, 0xb0, 0x4d, 0xcc, 0x08, 0x77, 0xb4, - 0xf0, 0xa4, 0x4d, 0x78, 0x61, 0x52, 0x8d, 0x76, 0x2f, 0xfc, 0xd3, 0x91, 0xce, 0xb9, 0xdd, 0xad, - 0xaf, 0x37, 0xe8, 0x0c, 0x91, 0xd7, 0x9b, 0x8c, 0xda, 0x84, 0xb7, 0x9a, 0x9c, 0xee, 0xae, 0x3e, - 0x0e, 0xac, 0x79, 0x93, 0x9b, 0xc6, 0xab, 0x12, 0xa3, 0x75, 0x89, 0xd1, 0x67, 0x89, 0xd1, 0x5b, - 0x85, 0xad, 0x75, 0x85, 0xad, 0xf7, 0x0a, 0x5b, 0x77, 0x37, 0x11, 0x57, 0xf1, 0xd2, 0x27, 0x81, - 0x48, 0xe8, 0x6c, 0x6b, 0xbd, 0x62, 0xbe, 0xa4, 0x66, 0xc6, 0x69, 0x20, 0x72, 0xf8, 0x7d, 0x8c, - 0x19, 0x4f, 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) { - 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.DerivativeMarkets) > 0 { - for iNdEx := len(m.DerivativeMarkets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DerivativeMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.SpotMarkets) > 0 { - for iNdEx := len(m.SpotMarkets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SpotMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SpotMarkets) > 0 { - for _, e := range m.SpotMarkets { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DerivativeMarkets) > 0 { - for _, e := range m.DerivativeMarkets { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpotMarkets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpotMarkets = append(m.SpotMarkets, &SpotMarket{}) - if err := m.SpotMarkets[len(m.SpotMarkets)-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 DerivativeMarkets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DerivativeMarkets = append(m.DerivativeMarkets, &DerivativeMarket{}) - if err := m.DerivativeMarkets[len(m.DerivativeMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/chain/exchange/types/key.go b/chain/exchange/types/key.go deleted file mode 100644 index 23407107..00000000 --- a/chain/exchange/types/key.go +++ /dev/null @@ -1,127 +0,0 @@ -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/exchange/types/module.go b/chain/exchange/types/module.go new file mode 100644 index 00000000..b49f9367 --- /dev/null +++ b/chain/exchange/types/module.go @@ -0,0 +1,5 @@ +package types + +const ( + ModuleName = "exchange" +) diff --git a/chain/exchange/types/msgs.go b/chain/exchange/types/msgs.go index 56ab48f0..a2d14226 100644 --- a/chain/exchange/types/msgs.go +++ b/chain/exchange/types/msgs.go @@ -2,101 +2,60 @@ package types import ( "bytes" - "fmt" - "math/big" - "strings" - 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" - ethcrypto "github.com/ethereum/go-ethereum/crypto" + "github.com/pkg/errors" ) const RouterKey = ModuleName var ( - _ sdk.Msg = &MsgRegisterDerivativeMarket{} - _ sdk.Msg = &MsgSuspendDerivativeMarket{} - _ sdk.Msg = &MsgResumeDerivativeMarket{} - _ sdk.Msg = &MsgRegisterDerivativeMarket{} - _ sdk.Msg = &MsgCreateDerivativeOrder{} - _ sdk.Msg = &MsgSoftCancelDerivativeOrder{} - _ sdk.Msg = &MsgRegisterSpotMarket{} - _ sdk.Msg = &MsgSuspendSpotMarket{} - _ sdk.Msg = &MsgResumeSpotMarket{} - _ sdk.Msg = &MsgCreateSpotOrder{} - _ sdk.Msg = &MsgExecuteDerivativeTakeOrder{} - _ sdk.Msg = &MsgExecuteTECTransaction{} - _ sdk.Msg = &MsgInitExchange{} + _ sdk.Msg = &MsgDeposit{} + _ sdk.Msg = &MsgWithdraw{} + _ sdk.Msg = &MsgCreateSpotLimitOrder{} + _ sdk.Msg = &MsgCreateSpotMarketOrder{} + _ sdk.Msg = &MsgCancelSpotOrder{} + _ sdk.Msg = &MsgCreateDerivativeLimitOrder{} + _ sdk.Msg = &MsgCreateDerivativeMarketOrder{} + _ sdk.Msg = &MsgCancelDerivativeOrder{} + _ sdk.Msg = &MsgSubaccountTransfer{} + _ sdk.Msg = &MsgExternalTransfer{} ) -func (msg *MsgInitExchange) Route() string { - return RouterKey -} - -func (msg *MsgInitExchange) Type() string { - return "msgInitExchange" -} - -func (msg *MsgInitExchange) ValidateBasic() error { - if msg.Sender.Empty() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender.String()) - } else if !common.IsHexAddress(msg.ExchangeAddress) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.ExchangeAddress) - } - return nil -} - -func (msg *MsgInitExchange) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) -} - -func (msg *MsgInitExchange) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{msg.Sender} -} - -func (msg *MsgSoftCancelDerivativeOrder) Route() string { - return RouterKey -} +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg MsgDeposit) Route() string { return RouterKey } -func (msg *MsgSoftCancelDerivativeOrder) Type() string { - return "softCancelDerivativeOrder" -} +// Type implements the sdk.Msg interface. It should return the action. +func (msg MsgDeposit) Type() string { return "msgDeposit" } -func (msg *MsgSoftCancelDerivativeOrder) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg MsgDeposit) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - if msg.Order == nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") + if !msg.Amount.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } - order := msg.Order.ToSignedOrder() - quantity := order.TakerAssetAmount - price := order.MakerAssetAmount - orderHash, err := order.ComputeOrderHash() - makerAddress := common.HexToAddress(msg.Order.MakerAddress) - - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) - } else 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") - } else if price == nil || price.Cmp(big.NewInt(0)) <= 0 { - return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient price") + if !msg.Amount.IsPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + } + if _, ok := IsValidSubaccountID(msg.SubaccountId); !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.SubaccountId) } return nil } -func (msg *MsgSoftCancelDerivativeOrder) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgDeposit) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -func (msg *MsgSoftCancelDerivativeOrder) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg MsgDeposit) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -104,107 +63,49 @@ func (msg *MsgSoftCancelDerivativeOrder) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgCreateSpotOrder) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg MsgWithdraw) Route() string { return RouterKey } -// Type should return the action -func (msg MsgCreateSpotOrder) Type() string { return "createSpotOrder" } +// Type implements the sdk.Msg interface. It should return the action. +func (msg MsgWithdraw) Type() string { return "msgWithdraw" } -// ValidateBasic runs stateless checks on the message -func (msg MsgCreateSpotOrder) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg MsgWithdraw) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - sOrder := msg.Order.ToSignedOrder() + if !msg.Amount.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + } - if msg.Order == nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") + if !msg.Amount.IsPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } - orderHash, err := msg.Order.ToSignedOrder().ComputeOrderHash() - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) + subaccountAddress, ok := IsValidSubaccountID(msg.SubaccountId) + if !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.SubaccountId) } - 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") + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return errors.Wrap(err, "must provide a valid Bech32 address") + } + if !bytes.Equal(subaccountAddress.Bytes(), senderAddr.Bytes()) { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.Sender) } return nil } -// isValidSignature checks that the signature of the order is correct -func isValidSignature(sig string, makerAddr common.Address, hash common.Hash) bool { - signature := common.FromHex(sig) - signatureType := zeroex.SignatureType(signature[len(signature)-1]) - switch signatureType { - case zeroex.InvalidSignature, zeroex.IllegalSignature: - return false - - case zeroex.EIP712Signature: - if len(signature) != 66 { - return false - } - - v := signature[0] - r := signature[1:33] - s := signature[33:65] - - //build Eth signature - EthSignature := make([]byte, 65) - copy(EthSignature[0:32], r) - copy(EthSignature[32:64], s) - EthSignature[64] = v - 27 - - //validate signature - pubKey, err := ethcrypto.SigToPub(hash[:], EthSignature) - if err != nil { - return false - } - - //compare recoveredAddr with makerAddress - recoveredAddr := ethcrypto.PubkeyToAddress(*pubKey) - return bytes.Equal(recoveredAddr.Bytes(), makerAddr.Bytes()) - case zeroex.EthSignSignature: - if len(signature) != 66 { - return false - } - - //validate signature - EthSignature := signature[:65] - EthSignature[64] = EthSignature[64] - 27 - pubKey, err := ethcrypto.SigToPub(hash[:], EthSignature) - if err != nil { - return false - } - - //compare recoveredAddr with makerAddress - recoveredAddr := ethcrypto.PubkeyToAddress(*pubKey) - return bytes.Equal(recoveredAddr.Bytes(), makerAddr.Bytes()) - case zeroex.ValidatorSignature: - if len(signature) < 21 { - return false - } - // TODO: not supported yet - return false - case zeroex.PreSignedSignature, zeroex.WalletSignature, zeroex.EIP1271WalletSignature: - // TODO: not supported yet - return false - default: - return false - } -} - -// GetSignBytes encodes the message for signing -func (msg *MsgCreateSpotOrder) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgWithdraw) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgCreateSpotOrder) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg MsgWithdraw) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -212,48 +113,37 @@ func (msg MsgCreateSpotOrder) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgCreateDerivativeOrder) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg MsgInstantSpotMarketLaunch) Route() string { return RouterKey } -// Type should return the action -func (msg MsgCreateDerivativeOrder) Type() string { return "createDerivativeOrder" } +// Type implements the sdk.Msg interface. It should return the action. +func (msg MsgInstantSpotMarketLaunch) Type() string { return "listingFeeBasedSpotMarketLaunch" } -// ValidateBasic runs stateless checks on the message -func (msg MsgCreateDerivativeOrder) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg MsgInstantSpotMarketLaunch) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - - if msg.Order == nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") + if msg.Ticker == "" { + return sdkerrors.Wrap(ErrInvalidTicker, "ticker should not be empty") } - - order := msg.Order.ToSignedOrder() - quantity := order.TakerAssetAmount - price := order.MakerAssetAmount - orderHash, err := order.ComputeOrderHash() - makerAddress := common.HexToAddress(msg.Order.MakerAddress) - - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) - } else 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") - } else if price == nil || price.Cmp(big.NewInt(0)) <= 0 { - return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient price") + if msg.BaseDenom == "" { + return sdkerrors.Wrap(ErrInvalidQuoteDenom, "base denom should not be empty") + } + if msg.QuoteDenom == "" { + return sdkerrors.Wrap(ErrInvalidBaseDenom, "quote denom should not be empty") } return nil } -// GetSignBytes encodes the message for signing -func (msg *MsgCreateDerivativeOrder) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgInstantSpotMarketLaunch) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgCreateDerivativeOrder) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg MsgInstantSpotMarketLaunch) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -261,39 +151,49 @@ func (msg MsgCreateDerivativeOrder) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgRegisterSpotMarket) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg MsgCreateSpotLimitOrder) Route() string { return RouterKey } -// Type should return the action -func (msg MsgRegisterSpotMarket) Type() string { return "registerSpotMarket" } +// Type implements the sdk.Msg interface. It should return the action. +func (msg MsgCreateSpotLimitOrder) Type() string { return "createSpotLimitOrder" } -// ValidateBasic runs stateless checks on the message -func (msg MsgRegisterSpotMarket) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg MsgCreateSpotLimitOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - if len(msg.Ticker) == 0 { - return sdkerrors.Wrap(ErrBadField, "no trade pair name specified") - } 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 msg.Order.MarketId == "" { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, msg.Order.MarketId) } - - 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") + if msg.Order.OrderType < 0 || msg.Order.OrderType > 5 { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, string(msg.Order.OrderType)) + } + if msg.Order.TriggerPrice.LT(sdk.ZeroDec()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Order.TriggerPrice.String()) + } + if msg.Order.OrderInfo.SubaccountId == "" { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, msg.Order.OrderInfo.SubaccountId) + } + if msg.Order.OrderInfo.FeeRecipient == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Order.OrderInfo.FeeRecipient) } + if msg.Order.OrderInfo.Price.LTE(sdk.ZeroDec()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Order.OrderInfo.Price.String()) + } + if msg.Order.OrderInfo.Quantity.LTE(sdk.ZeroDec()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Order.OrderInfo.Quantity.String()) + } + return nil } -// GetSignBytes encodes the message for signing -func (msg *MsgRegisterSpotMarket) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgCreateSpotLimitOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgRegisterSpotMarket) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg MsgCreateSpotLimitOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -301,55 +201,49 @@ func (msg MsgRegisterSpotMarket) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgRegisterDerivativeMarket) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg MsgCreateSpotMarketOrder) Route() string { return RouterKey } -// Type should return the action -func (msg MsgRegisterDerivativeMarket) Type() string { return "registerDerivativeMarket" } +// Type implements the sdk.Msg interface. It should return the action. +func (msg MsgCreateSpotMarketOrder) Type() string { return "createSpotMarketOrder" } -// ValidateBasic runs stateless checks on the message -func (msg MsgRegisterDerivativeMarket) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg MsgCreateSpotMarketOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - market := msg.Market - - if len(market.Ticker) == 0 { - return sdkerrors.Wrap(ErrBadField, "no market ticker name specified") - } else if parts := strings.Split(market.Ticker, "/"); len(parts) != 2 || - len(strings.TrimSpace(parts[0])) == 0 || len(strings.TrimSpace(parts[1])) == 0 { - return sdkerrors.Wrap(ErrBadField, "market ticker must be in format AAA/BBB") - } else if len(msg.Market.GetOracle()) != ADDRESS_LENGTH { - return sdkerrors.Wrap(ErrBadField, "oracle address must be of length 42") - } else if len(msg.Market.GetBaseCurrency()) != ADDRESS_LENGTH { - return sdkerrors.Wrap(ErrBadField, "base currency address must be of length 42") - } else if len(msg.Market.GetExchangeAddress()) != ADDRESS_LENGTH { - return sdkerrors.Wrap(ErrBadField, "exchange address must be of length 42") - } else if len(msg.Market.GetMarketId()) != BYTES32_LENGTH { - return sdkerrors.Wrapf(ErrBadField, "marketID must be of length 66 but got length %d", len(msg.Market.GetMarketId())) - } - - // TODO: (albertchon) proper validation here - //hash, err := market.Hash() - //if err != nil { - // return sdkerrors.Wrap(ErrMarketInvalid, err.Error()) - //} - //if hash.String() != market.MarketId { - // errMsg := "The MarketID " + market.MarketId + " provided does not match the MarketID " + hash.String() + " computed" - // errMsg += "\n for Ticker: " + market.Ticker + "\nOracle: " + market.Oracle + "\nBaseCurrency: " + market.BaseCurrency + "\nNonce: " + market.Nonce - // return sdkerrors.Wrap(ErrMarketInvalid, errMsg) - //} + if msg.Order.MarketId == "" { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, msg.Order.MarketId) + } + if msg.Order.OrderType < 0 || msg.Order.OrderType > 5 { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, string(msg.Order.OrderType)) + } + if msg.Order.TriggerPrice.LT(sdk.ZeroDec()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Order.TriggerPrice.String()) + } + if msg.Order.OrderInfo.SubaccountId == "" { + return sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, msg.Order.OrderInfo.SubaccountId) + } + if msg.Order.OrderInfo.FeeRecipient == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Order.OrderInfo.FeeRecipient) + } + if msg.Order.OrderInfo.Quantity.LTE(sdk.ZeroDec()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Order.OrderInfo.Quantity.String()) + } + if msg.Order.OrderInfo.Price.IsNil() { + return sdkerrors.Wrap(ErrOrderInvalid, "order worst price cannot be nil") + } return nil } -// GetSignBytes encodes the message for signing -func (msg *MsgRegisterDerivativeMarket) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgCreateSpotMarketOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgRegisterDerivativeMarket) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg MsgCreateSpotMarketOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -357,35 +251,29 @@ func (msg MsgRegisterDerivativeMarket) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgSuspendDerivativeMarket) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg *MsgCancelSpotOrder) Route() string { return RouterKey } -// Type should return the action -func (msg MsgSuspendDerivativeMarket) Type() string { - return "suspendDerivativeMarket" -} +// Type implements the sdk.Msg interface. It should return the action. +func (msg *MsgCancelSpotOrder) Type() string { return "cancelSpotOrder" } -// ValidateBasic runs stateless checks on the message -func (msg MsgSuspendDerivativeMarket) ValidateBasic() error { - // TODO: albertchon proper length checks here +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg *MsgCancelSpotOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) - } else if msg.MarketId == "" { - return sdkerrors.Wrap(ErrBadField, "no derivative market ID specified") - } else if msg.ExchangeAddress == "" { - return sdkerrors.Wrap(ErrBadField, "no derivative exchange address specified") - } + + // TODO: check if subaccountId and sender matches or not return nil } -// GetSignBytes encodes the message for signing -func (msg *MsgSuspendDerivativeMarket) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgCancelSpotOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgSuspendDerivativeMarket) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg *MsgCancelSpotOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -394,33 +282,45 @@ func (msg MsgSuspendDerivativeMarket) GetSigners() []sdk.AccAddress { } // Route should return the name of the module -func (msg MsgResumeDerivativeMarket) Route() string { return RouterKey } +func (msg MsgCreateDerivativeLimitOrder) Route() string { return RouterKey } // Type should return the action -func (msg MsgResumeDerivativeMarket) Type() string { - return "resumeDerivativeMarket" -} +func (msg MsgCreateDerivativeLimitOrder) Type() string { return "createDerivativeLimitOrder" } // ValidateBasic runs stateless checks on the message -func (msg MsgResumeDerivativeMarket) ValidateBasic() error { - // TODO: albertchon proper validation +func (msg MsgCreateDerivativeLimitOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) - } else if msg.MarketId == "" { - return sdkerrors.Wrap(ErrBadField, "no derivative market ID specified") - } else if msg.ExchangeAddress == "" { - return sdkerrors.Wrap(ErrBadField, "no derivative market ID specified") } + + //if msg.Order == nil { + // return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") + //} + // + //order := msg.Order.ToSignedOrder() + //quantity := order.TakerAssetAmount + //price := order.MakerAssetAmount + //orderHash, err := order.ComputeOrderHash() + //makerAddress := common.HexToAddress(msg.Order.MakerAddress) + // + //if err != nil { + // return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) + //} else if quantity == nil || quantity.Cmp(big.NewInt(0)) <= 0 { + // return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient quantity") + //} else if price == nil || price.Cmp(big.NewInt(0)) <= 0 { + // return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient price") + //} + return nil } // GetSignBytes encodes the message for signing -func (msg *MsgResumeDerivativeMarket) GetSignBytes() []byte { +func (msg *MsgCreateDerivativeLimitOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } // GetSigners defines whose signature is required -func (msg MsgResumeDerivativeMarket) GetSigners() []sdk.AccAddress { +func (msg MsgCreateDerivativeLimitOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -429,31 +329,27 @@ func (msg MsgResumeDerivativeMarket) GetSigners() []sdk.AccAddress { } // Route should return the name of the module -func (msg MsgSuspendSpotMarket) Route() string { return RouterKey } +func (msg MsgCreateDerivativeMarketOrder) Route() string { return RouterKey } // Type should return the action -func (msg MsgSuspendSpotMarket) Type() string { return "suspendSpotMarket" } +func (msg MsgCreateDerivativeMarketOrder) Type() string { return "createDerivativeMarketOrder" } // ValidateBasic runs stateless checks on the message -func (msg MsgSuspendSpotMarket) ValidateBasic() error { +func (msg MsgCreateDerivativeMarketOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - if len(msg.Name) == 0 { - return sdkerrors.Wrap(ErrBadField, "no trade pair name specified") - } - return nil } // GetSignBytes encodes the message for signing -func (msg *MsgSuspendSpotMarket) GetSignBytes() []byte { +func (msg *MsgCreateDerivativeMarketOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } // GetSigners defines whose signature is required -func (msg MsgSuspendSpotMarket) GetSigners() []sdk.AccAddress { +func (msg MsgCreateDerivativeMarketOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -461,32 +357,32 @@ func (msg MsgSuspendSpotMarket) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgResumeSpotMarket) Route() string { return RouterKey } +// Route implements the sdk.Msg interface. It should return the name of the module +func (msg *MsgCancelDerivativeOrder) Route() string { + return RouterKey +} -// Type should return the action -func (msg MsgResumeSpotMarket) Type() string { return "resumeSpotMarket" } +// Type implements the sdk.Msg interface. It should return the action. +func (msg *MsgCancelDerivativeOrder) Type() string { + return "cancelDerivativeOrder" +} -// ValidateBasic runs stateless checks on the message -func (msg MsgResumeSpotMarket) ValidateBasic() error { +// ValidateBasic implements the sdk.Msg interface. It runs stateless checks on the message +func (msg *MsgCancelDerivativeOrder) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - - if len(msg.Name) == 0 { - return sdkerrors.Wrap(ErrBadField, "no trade pair name specified") - } - + // TODO: implement this return nil } -// GetSignBytes encodes the message for signing -func (msg *MsgResumeSpotMarket) GetSignBytes() []byte { +// GetSignBytes implements the sdk.Msg interface. It encodes the message for signing +func (msg *MsgCancelDerivativeOrder) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgResumeSpotMarket) GetSigners() []sdk.AccAddress { +// GetSigners implements the sdk.Msg interface. It defines whose signature is required +func (msg *MsgCancelDerivativeOrder) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -494,47 +390,53 @@ func (msg MsgResumeSpotMarket) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -func (msg *MsgExecuteTECTransaction) Route() string { +func (msg *MsgSubaccountTransfer) Route() string { return RouterKey } -func (msg *MsgExecuteTECTransaction) Type() string { - return "executeTECTransaction" +func (msg *MsgSubaccountTransfer) Type() string { + return "subaccountTransfer" } -func (msg *MsgExecuteTECTransaction) ValidateBasic() error { +func (msg *MsgSubaccountTransfer) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } + if !msg.Amount.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + } + + if !msg.Amount.IsPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + } - // TODO: hash this and validate - transactionHash := common.Hash{} - - if len(msg.TecTransaction.Salt) == 0 { - return sdkerrors.Wrap(ErrBadField, "no salt specified") - } else if msg.TecTransaction.SignerAddress == "" { - return sdkerrors.Wrap(ErrBadField, "no signerAddress address specified") - } else if msg.TecTransaction.Domain.VerifyingContract == "" { - return sdkerrors.Wrap(ErrBadField, "no verifyingContract address specified") - } else if msg.TecTransaction.Domain.ChainId != "888" { - return sdkerrors.Wrap(ErrBadField, "wrong chainID specified") - } else if len(msg.TecTransaction.GasPrice) == 0 { - return sdkerrors.Wrap(ErrBadField, "no gasPrice specified") - } else if len(msg.TecTransaction.ExpirationTimeSeconds) == 0 { - return sdkerrors.Wrap(ErrBadField, "no expirationTimeSeconds specified") - } else if !isValidSignature(msg.TecTransaction.Signature, common.HexToAddress(msg.TecTransaction.SignerAddress), transactionHash) { - // TODO: fix this later - return nil - //return sdkerrors.Wrap(ErrBadField, "invalid transaction signature") + subaccountAddress, ok := IsValidSubaccountID(msg.SourceSubaccountId) + if !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.SourceSubaccountId) + } + destSubaccountAddress, ok := IsValidSubaccountID(msg.DestinationSubaccountId) + if !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.DestinationSubaccountId) + } + if !bytes.Equal(subaccountAddress.Bytes(), destSubaccountAddress.Bytes()) { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.DestinationSubaccountId) + } + + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return errors.Wrap(err, "must provide a valid Bech32 address") + } + if !bytes.Equal(subaccountAddress.Bytes(), senderAddr.Bytes()) { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.Sender) } return nil } -func (msg *MsgExecuteTECTransaction) GetSignBytes() []byte { +func (msg *MsgSubaccountTransfer) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -func (msg *MsgExecuteTECTransaction) GetSigners() []sdk.AccAddress { +func (msg *MsgSubaccountTransfer) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) @@ -542,52 +444,51 @@ func (msg *MsgExecuteTECTransaction) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// Route should return the name of the module -func (msg MsgExecuteDerivativeTakeOrder) Route() string { return RouterKey } +func (msg *MsgExternalTransfer) Route() string { + return RouterKey +} -// Type should return the action -func (msg MsgExecuteDerivativeTakeOrder) Type() string { return "executeDerivativeTakeOrder" } +func (msg *MsgExternalTransfer) Type() string { + return "externalTransfer" +} -// ValidateBasic runs stateless checks on the message -func (msg MsgExecuteDerivativeTakeOrder) ValidateBasic() error { +func (msg *MsgExternalTransfer) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - if msg.Order == nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") + if !msg.Amount.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } - order := msg.Order.ToSignedOrder() - quantity := order.TakerAssetAmount - margin := order.MakerFee - orderHash, err := order.ComputeOrderHash() - takerAddress := common.HexToAddress(msg.Order.TakerAddress) + if !msg.Amount.IsPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + } + sourceSubaccountAddress, ok := IsValidSubaccountID(msg.SourceSubaccountId) + if !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.SourceSubaccountId) + } + _, ok = IsValidSubaccountID(msg.DestinationSubaccountId) + if !ok { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.DestinationSubaccountId) + } + + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) - } else if !isValidSignature(msg.Order.Signature, takerAddress, orderHash) { - // TODO @albert @venkatesh: delete return nil once this is ready - return nil - //return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "invalid signature") - } else if quantity == nil || quantity.Cmp(big.NewInt(0)) <= 0 { - return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient quantity") - } else if margin == nil || margin.Cmp(big.NewInt(0)) <= 0 { - return sdkerrors.Wrap(ErrInsufficientTakerMargin, "insufficient margin") - } else if !bytes.Equal(order.MakerAddress.Bytes(), common.Address{}.Bytes()) { - return sdkerrors.Wrap(ErrBadField, "maker address field must be empty") - } else if bytes.Equal(order.TakerAddress.Bytes(), common.Address{}.Bytes()) { - return sdkerrors.Wrap(ErrBadField, "taker address field must not be empty") + return errors.Wrap(err, "must provide a valid Bech32 address") + } + if !bytes.Equal(sourceSubaccountAddress.Bytes(), senderAddr.Bytes()) { + return sdkerrors.Wrap(ErrBadSubaccountID, msg.Sender) } return nil } -func (msg *MsgExecuteDerivativeTakeOrder) GetSignBytes() []byte { +func (msg *MsgExternalTransfer) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) } -// GetSigners defines whose signature is required -func (msg MsgExecuteDerivativeTakeOrder) GetSigners() []sdk.AccAddress { +func (msg *MsgExternalTransfer) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { panic(err) diff --git a/chain/exchange/types/msgs.pb.go b/chain/exchange/types/msgs.pb.go deleted file mode 100644 index 7d6b0d16..00000000 --- a/chain/exchange/types/msgs.pb.go +++ /dev/null @@ -1,3136 +0,0 @@ -// 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, 0xd1, 0x93, 0xd9, - 0xd9, 0xe9, 0x76, 0x21, 0xb4, 0x70, 0x51, 0x4e, 0xdd, 0x7d, 0xe7, 0x99, 0xe7, 0xf9, 0xe5, 0x9d, - 0xb7, 0x3b, 0x30, 0xe7, 0x05, 0x6f, 0xd0, 0x96, 0xde, 0x2e, 0x9a, 0xb8, 0x67, 0xb7, 0x79, 0xe0, - 0xa2, 0xb9, 0xbb, 0xd8, 0x42, 0xc9, 0x17, 0x4d, 0x9f, 0x5c, 0x32, 0xba, 0xa1, 0x90, 0xa2, 0x58, - 0x4e, 0x65, 0x46, 0x4f, 0x66, 0x68, 0x59, 0x79, 0xd2, 0x15, 0xae, 0x50, 0x32, 0x33, 0x7e, 0x4a, - 0x76, 0x94, 0x17, 0x86, 0x18, 0xa7, 0x16, 0x4a, 0x5a, 0xfb, 0xce, 0x60, 0xa2, 0x49, 0xee, 0x7a, - 0xe0, 0xc9, 0x35, 0xbd, 0x52, 0xdc, 0x82, 0x3c, 0x61, 0xe0, 0x60, 0x58, 0x62, 0xb3, 0x6c, 0xfe, - 0x46, 0xa3, 0x71, 0x7a, 0x54, 0xbd, 0xb9, 0xcf, 0xfd, 0x9d, 0xa5, 0x5a, 0x52, 0xaf, 0xfd, 0x3e, - 0xaa, 0xd6, 0x5d, 0x4f, 0xb6, 0xa3, 0x96, 0x61, 0x0b, 0xdf, 0xb4, 0x05, 0xf9, 0x82, 0xf4, 0x4f, - 0x9d, 0x9c, 0x8e, 0x29, 0xf7, 0xbb, 0x48, 0xc6, 0xb2, 0x6d, 0x2f, 0x3b, 0x4e, 0x88, 0x44, 0x96, - 0x76, 0x2c, 0x3e, 0x83, 0xdb, 0x3d, 0x82, 0x6d, 0x9e, 0xac, 0x95, 0xfe, 0x9b, 0x65, 0xf3, 0x85, - 0xc6, 0xf4, 0xe9, 0x51, 0xf5, 0x5e, 0x92, 0x72, 0x5e, 0x51, 0xb3, 0x26, 0x7a, 0x25, 0xed, 0xb7, - 0x34, 0xfa, 0xe1, 0x6b, 0x35, 0x57, 0x23, 0x28, 0x36, 0xc9, 0x5d, 0x09, 0x91, 0x4b, 0xdc, 0xe8, - 0x0a, 0xf9, 0x32, 0x8c, 0x33, 0xa6, 0xce, 0xf0, 0x17, 0xd2, 0xec, 0xa7, 0x30, 0x26, 0x62, 0x81, - 0x0a, 0x1c, 0x7f, 0xb4, 0x60, 0x0c, 0x6e, 0xac, 0xd1, 0xe0, 0xd4, 0x77, 0xb4, 0x92, 0x7d, 0x3a, - 0x34, 0x82, 0x52, 0x1a, 0xba, 0x8a, 0xa1, 0xb7, 0xcb, 0x63, 0x8b, 0xe1, 0xd1, 0x4f, 0xce, 0x46, - 0xcf, 0x5d, 0x16, 0x7d, 0x41, 0xec, 0x3e, 0x3c, 0x68, 0x92, 0xbb, 0x21, 0x5e, 0xcb, 0x15, 0x1e, - 0xd8, 0xb8, 0xf3, 0x0f, 0xa3, 0xbf, 0x31, 0xb8, 0xdb, 0x24, 0xd7, 0x42, 0xd7, 0x23, 0x89, 0x61, - 0xdc, 0x97, 0x26, 0x0f, 0x3b, 0x28, 0x07, 0x86, 0x4e, 0x41, 0x5e, 0x7a, 0x76, 0x47, 0xa7, 0x16, - 0x2c, 0xfd, 0x56, 0x9c, 0x01, 0x68, 0x71, 0xc2, 0x6d, 0x4e, 0x84, 0xb2, 0x34, 0xa2, 0xd6, 0x0a, - 0x71, 0x65, 0x39, 0x2e, 0x14, 0xab, 0x30, 0xfe, 0x36, 0x12, 0xb2, 0xb7, 0x3e, 0xaa, 0xd6, 0x41, - 0x95, 0x12, 0xc1, 0xc2, 0x05, 0xe3, 0x33, 0xa6, 0x54, 0x03, 0x26, 0xe4, 0x13, 0x83, 0xc9, 0xb8, - 0x6d, 0x11, 0x75, 0x31, 0x70, 0xae, 0x40, 0x5e, 0x84, 0xd1, 0x80, 0xfb, 0xa8, 0xb9, 0xd5, 0x73, - 0x8c, 0xe5, 0xf3, 0x0e, 0x86, 0x67, 0xb0, 0x41, 0x95, 0x52, 0x6e, 0x99, 0x11, 0x68, 0x6e, 0x99, - 0x0a, 0x34, 0xcc, 0x47, 0x06, 0x77, 0x54, 0x1f, 0x29, 0xf2, 0xf1, 0x9a, 0x59, 0x0e, 0x18, 0x4c, - 0x67, 0xce, 0xb4, 0x3f, 0x4d, 0x97, 0x30, 0xad, 0x42, 0xde, 0x57, 0x0a, 0x3d, 0x4f, 0x0f, 0x87, - 0xcd, 0xd3, 0x79, 0x57, 0x4b, 0xef, 0xd5, 0x0c, 0xef, 0x19, 0x94, 0xfb, 0x87, 0x73, 0x65, 0x84, - 0x69, 0x28, 0x24, 0x36, 0xdb, 0x9e, 0xa3, 0x7b, 0xf3, 0x7f, 0x52, 0x58, 0x77, 0x2e, 0x9c, 0x90, - 0x91, 0x61, 0x13, 0x72, 0xc0, 0xe0, 0x7e, 0x7a, 0x28, 0xd7, 0xc4, 0xf0, 0x0e, 0x66, 0x9a, 0xe4, - 0xae, 0xed, 0xa1, 0x1d, 0x65, 0xbf, 0x29, 0x9b, 0xbc, 0xf3, 0xf7, 0xff, 0xdc, 0x9f, 0x99, 0xfa, - 0x9e, 0xe9, 0xf0, 0xcd, 0xb5, 0x95, 0xcd, 0x90, 0x07, 0xc4, 0x6d, 0xe9, 0x89, 0x60, 0x60, 0xee, - 0x2b, 0xb8, 0x25, 0xd1, 0xce, 0x28, 0x35, 0x40, 0x7d, 0x18, 0xc0, 0x86, 0xe7, 0x06, 0xe8, 0x64, - 0x36, 0x59, 0xe7, 0x4c, 0x12, 0xa2, 0x46, 0xfb, 0xc7, 0x71, 0x85, 0x1d, 0x1e, 0x57, 0xd8, 0xaf, - 0xe3, 0x0a, 0xfb, 0x72, 0x52, 0xc9, 0x1d, 0x9e, 0x54, 0x72, 0x3f, 0x4f, 0x2a, 0xb9, 0xad, 0x17, - 0x99, 0x4b, 0x67, 0xbd, 0x17, 0xf4, 0x9c, 0xb7, 0xc8, 0x4c, 0x63, 0xeb, 0xb6, 0x08, 0x31, 0xfb, - 0xda, 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/orderbook.go b/chain/exchange/types/orderbook.go new file mode 100644 index 00000000..6e0d0ed0 --- /dev/null +++ b/chain/exchange/types/orderbook.go @@ -0,0 +1,34 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/types" +) + +type OrderbookStateChange struct { + NewBuyOrderbookFills *OrderbookFills + RestingBuyOrderbookFills *OrderbookFills + NewSellOrderbookFills *OrderbookFills + RestingSellOrderbookFills *OrderbookFills + ClearingPrice types.Dec +} + +type Orderbook interface { + GetNotional() types.Dec + GetTotalQuantityFilled() types.Dec + GetTransientOrderbookFills() *OrderbookFills + GetRestingOrderbookFills() *OrderbookFills + Done() bool + Peek() *PriceLevel + Fill(types.Dec) error + Close() error +} + +type OrderbookFills struct { + Orders []*SpotLimitOrder + FillQuantities []types.Dec +} + +type PriceLevel struct { + Price types.Dec + Quantity types.Dec +} diff --git a/chain/exchange/types/orders.go b/chain/exchange/types/orders.go index 0a2cf96c..c1e662cd 100644 --- a/chain/exchange/types/orders.go +++ b/chain/exchange/types/orders.go @@ -1,320 +1,53 @@ package types import ( - "bytes" - "errors" - "math/big" - "time" - - chainsdk "github.com/InjectiveLabs/sdk-go" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "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) -} +var ZeroHash = common.Hash{} -// ToSignedOrder returns an appropriate zeroex.SignedOrder defined by SafeSignedOrder. -func (m *BaseOrder) ToSignedOrder() *chainsdk.SignedOrder { - o, err := so2zo(m) - if err != nil { - panic(err) +func (o *SpotOrder) GetNewSpotLimitOrder(hash common.Hash) *SpotLimitOrder { + return &SpotLimitOrder{ + OrderInfo: o.OrderInfo, + OrderType: o.OrderType, + Fillable: o.OrderInfo.Quantity, + TriggerPrice: o.TriggerPrice, + Hash: hash.Bytes(), } - return o } -func (order *Order) IsReduceOnly() bool { - return BigNum(order.GetOrder().GetMakerFee()).Int().Cmp(big.NewInt(0)) == 0 +type SpotOrderStateExpansion struct { + BaseChangeAmount sdk.Dec + QuoteChangeAmount sdk.Dec + QuoteRefundAmount sdk.Dec + FeeRecipient common.Address + FeeRecipientReward sdk.Dec + AuctionFeeReward sdk.Dec + Hash common.Hash + SubaccountID common.Hash + // for market orders, FillableAmount refers to the fillable quantity of the market order execution (if any) + FillableAmount sdk.Dec } -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 +type SpotMarketBatchExecutionData struct { + Market *SpotMarket + BaseDenomDepositMap map[common.Hash]*DepositDelta + QuoteDenomDepositMap map[common.Hash]*DepositDelta + BaseDenomDepositSubaccountIDs []common.Hash + QuoteDenomDepositSubaccountIDs []common.Hash + LimitOrderFilledDeltas []*SpotLimitOrderFilledDelta + MarketOrderExecutionEvent *EventBatchSpotExecution + LimitOrderExecutionEvent []*EventBatchSpotExecution + NewOrdersEvent *EventNewSpotOrders } -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 +type SpotLimitOrderFilledDelta struct { + SubaccountIndexKey []byte + FillableAmount sdk.Dec } -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 +type DepositDelta struct { + AvailableBalanceDelta sdk.Dec + TotalBalanceDelta sdk.Dec } diff --git a/chain/exchange/types/params.go b/chain/exchange/types/params.go index d33f9760..428d945d 100644 --- a/chain/exchange/types/params.go +++ b/chain/exchange/types/params.go @@ -3,14 +3,43 @@ package types import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = &Params{} +// Exchange params default values +const ( + // DefaultFundingIntervalSeconds is 3600. This represents the number of seconds in one hour which is the frequency at which + // funding is applied by default on derivative markets. + DefaultFundingIntervalSeconds int64 = 3600 + + // DefaultFundingMultipleSeconds is 3600. This represents the number of seconds in one hour which is multiple of the + // unix time seconds timestamp that each perpetual market's funding timestamp should be. This ensures that + // funding is consistently applied on the hour for all perpetual markets. + DefaultFundingMultipleSeconds int64 = 3600 + + // SpotMarketInstantListingFee is 1000 INJ + SpotMarketInstantListingFee int64 = 1000 + + // DerivativeMarketInstantListingFee is 1000 INJ + DerivativeMarketInstantListingFee int64 = 1000 +) + // Parameter keys var ( - ParamStoreKeyExchangeParams = []byte("ExchangeParams") + KeySpotMarketInstantListingFee = []byte("SpotMarketInstantListingFee") + KeyDerivativeMarketInstantListingFee = []byte("DerivativeMarketInstantListingFee") + KeyDefaultSpotMakerFeeRate = []byte("DefaultSpotMakerFeeRate") + KeyDefaultSpotTakerFeeRate = []byte("DefaultSpotTakerFeeRate") + KeyDefaultDerivativeMakerFeeRate = []byte("DefaultDerivativeMakerFeeRate") + KeyDefaultDerivativeTakerFeeRate = []byte("DefaultDerivativeTakerFeeRate") + KeyDefaultInitialMarginRatio = []byte("DefaultInitialMarginRatio") + KeyDefaultMaintenanceMarginRatio = []byte("DefaultMaintenanceMarginRatio") + KeyDefaultFundingInterval = []byte("DefaultFundingInterval") + KeyFundingMultiple = []byte("FundingMultiple") + KeyRelayerFeeShareRate = []byte("RelayerFeeShareRate") ) // ParamKeyTable returns the parameter key table. @@ -19,29 +48,189 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(ep ExchangeParams) Params { +func NewParams( + SpotMarketInstantListingFee sdk.Coin, + derivativeMarketInstantListingFee sdk.Coin, + defaultSpotMakerFee sdk.Dec, + defaultSpotTakerFee sdk.Dec, + defaultDerivativeMakerFee sdk.Dec, + defaultDerivativeTakerFee sdk.Dec, + defaultInitialMarginRatio sdk.Dec, + defaultMaintenanceMarginRatio sdk.Dec, + defaultFundingInterval int64, + fundingMultiple int64, + relayerFeeShare sdk.Dec, +) Params { return Params{ - ExchangeParams: ep, + SpotMarketInstantListingFee: SpotMarketInstantListingFee, + DerivativeMarketInstantListingFee: derivativeMarketInstantListingFee, + DefaultSpotMakerFeeRate: defaultSpotMakerFee, + DefaultSpotTakerFeeRate: defaultSpotTakerFee, + DefaultDerivativeMakerFeeRate: defaultDerivativeMakerFee, + DefaultDerivativeTakerFeeRate: defaultDerivativeTakerFee, + DefaultInitialMarginRatio: defaultInitialMarginRatio, + DefaultMaintenanceMarginRatio: defaultMaintenanceMarginRatio, + DefaultFundingInterval: defaultFundingInterval, + FundingMultiple: fundingMultiple, + RelayerFeeShareRate: relayerFeeShare, } } // ParamSetPairs returns the parameter set pairs. -func (m *Params) ParamSetPairs() paramtypes.ParamSetPairs { +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + // TODO: @albert, add the rest of the parameters return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(ParamStoreKeyExchangeParams, &m.ExchangeParams, validateExchangeParams), + paramtypes.NewParamSetPair(KeySpotMarketInstantListingFee, &p.SpotMarketInstantListingFee, validateSpotMarketInstantListingFee), + paramtypes.NewParamSetPair(KeyDerivativeMarketInstantListingFee, &p.DerivativeMarketInstantListingFee, validateDerivativeMarketInstantListingFee), + paramtypes.NewParamSetPair(KeyDefaultSpotMakerFeeRate, &p.DefaultSpotMakerFeeRate, ValidateFee), + paramtypes.NewParamSetPair(KeyDefaultSpotTakerFeeRate, &p.DefaultSpotTakerFeeRate, ValidateFee), + paramtypes.NewParamSetPair(KeyDefaultDerivativeMakerFeeRate, &p.DefaultDerivativeMakerFeeRate, ValidateFee), + paramtypes.NewParamSetPair(KeyDefaultDerivativeTakerFeeRate, &p.DefaultDerivativeTakerFeeRate, ValidateFee), + paramtypes.NewParamSetPair(KeyDefaultInitialMarginRatio, &p.DefaultInitialMarginRatio, ValidateMarginRatio), + paramtypes.NewParamSetPair(KeyDefaultMaintenanceMarginRatio, &p.DefaultMaintenanceMarginRatio, ValidateMarginRatio), + paramtypes.NewParamSetPair(KeyDefaultFundingInterval, &p.DefaultFundingInterval, validateFundingInterval), + paramtypes.NewParamSetPair(KeyFundingMultiple, &p.FundingMultiple, validateFundingMultiple), + paramtypes.NewParamSetPair(KeyRelayerFeeShareRate, &p.RelayerFeeShareRate, ValidateFee), + } +} + +// DefaultParams returns a default set of parameters. +func DefaultParams() Params { + + return Params{ + SpotMarketInstantListingFee: NewInjectiveCoin(sdk.NewIntWithDecimal(SpotMarketInstantListingFee, BaseDenomUnit)), + DerivativeMarketInstantListingFee: NewInjectiveCoin(sdk.NewIntWithDecimal(DerivativeMarketInstantListingFee, BaseDenomUnit)), + DefaultSpotMakerFeeRate: sdk.NewDecWithPrec(1, 3), // default 0.1% fees + DefaultSpotTakerFeeRate: sdk.NewDecWithPrec(2, 3), // default 0.2% fees + DefaultDerivativeMakerFeeRate: sdk.NewDecWithPrec(5, 3), + DefaultDerivativeTakerFeeRate: sdk.NewDecWithPrec(5, 3), + DefaultInitialMarginRatio: sdk.NewDecWithPrec(20, 2), // default 20% initial margin ratio + DefaultMaintenanceMarginRatio: sdk.NewDecWithPrec(10, 2), // default 10% maintenance margin ratio + DefaultFundingInterval: DefaultFundingIntervalSeconds, + FundingMultiple: DefaultFundingMultipleSeconds, + RelayerFeeShareRate: sdk.NewDecWithPrec(40, 2), } } // Validate performs basic validation on exchange parameters. -func (m Params) Validate() error { - return validateExchangeParams(m.ExchangeParams) +func (p Params) Validate() error { + if err := validateSpotMarketInstantListingFee(p.SpotMarketInstantListingFee); err != nil { + return err + } + if err := validateDerivativeMarketInstantListingFee(p.DerivativeMarketInstantListingFee); err != nil { + return err + } + if err := ValidateFee(p.DefaultSpotMakerFeeRate); err != nil { + return err + } + if err := ValidateFee(p.DefaultSpotTakerFeeRate); err != nil { + return err + } + if err := ValidateFee(p.DefaultDerivativeMakerFeeRate); err != nil { + return err + } + if err := ValidateFee(p.DefaultDerivativeTakerFeeRate); err != nil { + return err + } + if err := ValidateMarginRatio(p.DefaultInitialMarginRatio); err != nil { + return err + } + if err := ValidateMarginRatio(p.DefaultMaintenanceMarginRatio); err != nil { + return err + } + if err := validateFundingInterval(p.DefaultFundingInterval); err != nil { + return err + } + if err := validateFundingMultiple(p.FundingMultiple); err != nil { + return err + } + if err := ValidateFee(p.RelayerFeeShareRate); err != nil { + return err + } + + return nil +} + +func validateSpotMarketInstantListingFee(i interface{}) error { + v, ok := i.(sdk.Coin) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if !v.IsValid() || !v.Amount.IsPositive() { + return fmt.Errorf("invalid SpotMarketInstantListingFee: %T", i) + } + + return nil +} + +func validateDerivativeMarketInstantListingFee(i interface{}) error { + v, ok := i.(sdk.Coin) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if !v.IsValid() || !v.Amount.IsPositive() { + return fmt.Errorf("invalid DerivativeMarketInstantListingFee: %T", i) + } + + return nil +} + +func ValidateFee(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() { + return fmt.Errorf("exchange fee cannot be negative: %s", v) + } + if v.GT(sdk.OneDec()) { + return fmt.Errorf("exchange fee cannot be greater than 1: %s", v) + } + + return nil +} + +func ValidateMarginRatio(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() { + return fmt.Errorf("margin ratio cannot be negative: %s", v) + } + if v.GT(sdk.OneDec()) { + return fmt.Errorf("margin ratio cannot be greater than 1: %s", v) + } + + return nil +} + +func validateFundingInterval(i interface{}) error { + v, ok := i.(int64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v == 0 { + return fmt.Errorf("fundingInterval must be positive: %d", v) + } + + return nil } -func validateExchangeParams(i interface{}) error { - _, ok := i.(ExchangeParams) +func validateFundingMultiple(i interface{}) error { + v, ok := i.(int64) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } + if v == 0 { + return fmt.Errorf("fundingMultiple must be positive: %d", v) + } + return nil } diff --git a/chain/exchange/types/params.pb.go b/chain/exchange/types/params.pb.go deleted file mode 100644 index 6eb5e90b..00000000 --- a/chain/exchange/types/params.pb.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/exchange/v1beta1/params.proto - -package types - -import ( - fmt "fmt" - _ "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 - -type ExchangeParams struct { - ExchangeAddress string `protobuf:"bytes,1,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty" yaml:"exchange_address"` -} - -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_5dcb14bddcf3d3c8, []int{0} -} -func (m *ExchangeParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExchangeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExchangeParams.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 *ExchangeParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExchangeParams.Merge(m, src) -} -func (m *ExchangeParams) XXX_Size() int { - return m.Size() -} -func (m *ExchangeParams) XXX_DiscardUnknown() { - xxx_messageInfo_ExchangeParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ExchangeParams proto.InternalMessageInfo - -func (m *ExchangeParams) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -type Params struct { - ExchangeParams ExchangeParams `protobuf:"bytes,1,opt,name=exchange_params,json=exchangeParams,proto3" json:"exchange_params"` -} - -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_5dcb14bddcf3d3c8, []int{1} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetExchangeParams() ExchangeParams { - if m != nil { - return m.ExchangeParams - } - return ExchangeParams{} -} - -func init() { - proto.RegisterType((*ExchangeParams)(nil), "injective.exchange.v1beta1.ExchangeParams") - proto.RegisterType((*Params)(nil), "injective.exchange.v1beta1.Params") -} - -func init() { - proto.RegisterFile("injective/exchange/v1beta1/params.proto", fileDescriptor_5dcb14bddcf3d3c8) -} - -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) { - 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 *ExchangeParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExchangeParams) 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 = encodeVarintParams(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ExchangeParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ExchangeParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ExchangeParams.Size() - n += 1 + l + sovParams(uint64(l)) - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ExchangeParams) 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 ErrIntOverflowParams - } - 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: ExchangeParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExchangeParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExchangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/chain/exchange/types/paramset.go b/chain/exchange/types/paramset.go deleted file mode 100644 index 80d0852b..00000000 --- a/chain/exchange/types/paramset.go +++ /dev/null @@ -1,26 +0,0 @@ -package types - -type ( - ValueValidatorFn func(value interface{}) error - - // ParamSetPair is used for associating paramsubspace key and field of param - // structs. - ParamSetPair struct { - Key []byte - Value interface{} - ValidatorFn ValueValidatorFn - } -) - -// NewParamSetPair creates a new ParamSetPair instance. -func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair { - return ParamSetPair{key, value, vfn} -} - -// ParamSetPairs Slice of KeyFieldPair -type ParamSetPairs []ParamSetPair - -// ParamSet defines an interface for structs containing parameters for a module -type ParamSet interface { - ParamSetPairs() ParamSetPairs -} diff --git a/chain/exchange/types/proposal.go b/chain/exchange/types/proposal.go index db431779..6d235bf8 100644 --- a/chain/exchange/types/proposal.go +++ b/chain/exchange/types/proposal.go @@ -1,80 +1,355 @@ package types import ( - "fmt" + "errors" + "github.com/ethereum/go-ethereum/common" + "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" gov "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/ethereum/go-ethereum/common" ) // constants const ( - //ProposalTypeRegisterTokenMapping string = "RegisterTokenMapping" - ProposalTypeRegisterExchange string = "RegisterExchange" + ProposalTypeSpotMarketParamUpdate string = "ProposalTypeSpotMarketParamUpdate" + ProposalTypeSpotMarketLaunch string = "ProposalTypeSpotMarketLaunch" + ProposalTypeSetSpotMarketStatus string = "ProposalTypeSetSpotMarketStatus" + ProposalTypePerpetualMarketLaunch string = "ProposalTypePerpetualMarketLaunch" + ProposalTypeExpiryFuturesMarketLaunch string = "ProposalTypeExpiryFuturesMarketLaunch" + ProposalTypeDerivativeMarketParamUpdate string = "ProposalTypeDerivativeMarketParamUpdate" + ProposalTypeSetDerivativeMarketStatus string = "ProposalTypeSetDerivativeMarketStatus" ) func init() { - //gov.RegisterProposalType(ProposalTypeRegisterTokenMapping) - gov.RegisterProposalType(ProposalTypeRegisterExchange) - gov.RegisterProposalTypeCodec(&RegisterExchangeProposal{}, "cosmos-sdk/RegisterExchangeProposal") - //gov.RegisterProposalTypeCodec(&ResetHubProposal{}, "cosmos-sdk/ResetHubProposal") -} - -//// NewTokenMapping returns an instance of TokenMapping -//func NewTokenMapping(name string, erc20Address string, cosmosDenom string, scalingFactor int64, enabled bool) TokenMapping { -// return TokenMapping{ -// Name: name, -// Erc20Address: erc20Address, -// CosmosDenom: cosmosDenom, -// ScalingFactor: scalingFactor, -// Enabled: true, -// } -//} -// -//// NewRegisterTokenMappingProposal returns new instance of TokenMappingProposal -//func NewRegisterTokenMappingProposal(title, description string, mapping TokenMapping) gov.Content { -// return &RegisterTokenMappingProposal{title, description, mapping} -//} -// -//// Implements Proposal Interface -//var _ gov.Content = &RegisterTokenMappingProposal{} -// -//// ProposalRoute returns router key for this proposal -//func (sup *RegisterTokenMappingProposal) ProposalRoute() string { return RouterKey } -// -//// ProposalType returns proposal type for this proposal -//func (sup *RegisterTokenMappingProposal) ProposalType() string { -// return ProposalTypeRegisterTokenMapping -//} -// -//// ValidateBasic returns ValidateBasic result for this proposal -//func (sup *RegisterTokenMappingProposal) ValidateBasic() error { -// if err := sup.Mapping.ValidateBasic(); err != nil { -// return err -// } -// return gov.ValidateAbstract(sup) -//} - -// NewRegisterExchangeProposal returns new instance of RegisterExchangeProposal -func NewRegisterExchangeProposal(title, description string, exchange_address string) gov.Content { - return &RegisterExchangeProposal{title, description, exchange_address} + gov.RegisterProposalType(ProposalTypeSpotMarketParamUpdate) + gov.RegisterProposalTypeCodec(&SpotMarketParamUpdateProposal{}, "injective/SpotMarketParamUpdateProposal") + gov.RegisterProposalType(ProposalTypeSpotMarketLaunch) + gov.RegisterProposalTypeCodec(&SpotMarketLaunchProposal{}, "injective/SpotMarketLaunchProposal") + gov.RegisterProposalType(ProposalTypeSetSpotMarketStatus) + gov.RegisterProposalTypeCodec(&SpotMarketStatusSetProposal{}, "injective/SpotMarketStatusSetProposal") + gov.RegisterProposalType(ProposalTypePerpetualMarketLaunch) + gov.RegisterProposalTypeCodec(&PerpetualMarketLaunchProposal{}, "injective/PerpetualMarketLaunchProposal") + gov.RegisterProposalType(ProposalTypeExpiryFuturesMarketLaunch) + gov.RegisterProposalTypeCodec(&ExpiryFuturesMarketLaunchProposal{}, "injective/ExpiryFuturesMarketLaunchProposal") + gov.RegisterProposalType(ProposalTypeDerivativeMarketParamUpdate) + gov.RegisterProposalTypeCodec(&DerivativeMarketParamUpdateProposal{}, "injective/DerivativeMarketParamUpdateProposal") + gov.RegisterProposalType(ProposalTypeSetDerivativeMarketStatus) + gov.RegisterProposalTypeCodec(&DerivativeMarketStatusSetProposal{}, "injective/DerivativeMarketStatusSetProposal") +} + +// NewSpotMarketParamUpdateProposal returns new instance of SpotMarketParamUpdateProposal +func NewSpotMarketParamUpdateProposal(title, description string, marketID common.Hash, makerFeeRate, takerFeeRate, relayerFeeShareRate sdk.Dec) *SpotMarketParamUpdateProposal { + return &SpotMarketParamUpdateProposal{ + title, description, marketID.Hex(), makerFeeRate, takerFeeRate, relayerFeeShareRate, + } +} + +// Implements Proposal Interface +var _ gov.Content = &SpotMarketParamUpdateProposal{} + +// GetTitle returns the title of this proposal. +func (p *SpotMarketParamUpdateProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *SpotMarketParamUpdateProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *SpotMarketParamUpdateProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *SpotMarketParamUpdateProposal) ProposalType() string { + return ProposalTypeSpotMarketLaunch +} + +// ValidateBasic returns ValidateBasic result of this proposal. +func (p *SpotMarketParamUpdateProposal) ValidateBasic() error { + + if err := ValidateFee(p.MakerFeeRate); err != nil { + return err + } + if err := ValidateFee(p.TakerFeeRate); err != nil { + return err + } + if err := ValidateFee(p.RelayerFeeShareRate); err != nil { + return err + } + if p.MakerFeeRate.GT(p.TakerFeeRate) { + return errors.New("MakerFeeRate cannot be greater than TakerFeeRate") + } + return gov.ValidateAbstract(p) +} + +// NewSpotMarketLaunchProposal returns new instance of SpotMarketLaunchProposal +func NewSpotMarketLaunchProposal(title, description, ticker, baseDenom, quoteDenom string) *SpotMarketLaunchProposal { + return &SpotMarketLaunchProposal{ + title, description, ticker, baseDenom, quoteDenom, + } } // Implements Proposal Interface -var _ gov.Content = &RegisterExchangeProposal{} +var _ gov.Content = &SpotMarketLaunchProposal{} + +// GetTitle returns the title of this proposal. +func (p *SpotMarketLaunchProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *SpotMarketLaunchProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *SpotMarketLaunchProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *SpotMarketLaunchProposal) ProposalType() string { + return ProposalTypeSpotMarketLaunch +} + +// ValidateBasic returns ValidateBasic result of this proposal. +func (p *SpotMarketLaunchProposal) ValidateBasic() error { + if err := types.ValidateDenom(p.BaseDenom); err != nil { + return err + } + if err := types.ValidateDenom(p.QuoteDenom); err != nil { + return err + } + return gov.ValidateAbstract(p) +} + +// NewSpotMarketStatusSetProposal returns new instance of SpotMarketStatusSetProposal +func NewSpotMarketStatusSetProposal(title, description, baseDenom, quoteDenom string, status MarketStatus) *SpotMarketStatusSetProposal { + return &SpotMarketStatusSetProposal{ + title, description, baseDenom, quoteDenom, status, + } +} + +// Implements Proposal Interface +var _ gov.Content = &SpotMarketStatusSetProposal{} + +// GetTitle returns the title of this proposal. +func (p *SpotMarketStatusSetProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *SpotMarketStatusSetProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *SpotMarketStatusSetProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *SpotMarketStatusSetProposal) ProposalType() string { + return ProposalTypeSetSpotMarketStatus +} + +// ValidateBasic returns ValidateBasic result of this proposal. +func (p *SpotMarketStatusSetProposal) ValidateBasic() error { + if err := types.ValidateDenom(p.BaseDenom); err != nil { + return err + } + if err := types.ValidateDenom(p.QuoteDenom); err != nil { + return err + } + if p.Status.String() == "" { + return errors.New("Invalid status") + } + return gov.ValidateAbstract(p) +} + +// NewDerivativeMarketStatusSetProposal returns new instance of DerivativeMarketStatusSetProposal +func NewDerivativeMarketStatusSetProposal(title, description, marketID string, status MarketStatus) *DerivativeMarketStatusSetProposal { + return &DerivativeMarketStatusSetProposal{ + title, description, marketID, status, + } +} + +// Implements Proposal Interface +var _ gov.Content = &DerivativeMarketStatusSetProposal{} + +// GetTitle returns the title of this proposal. +func (p *DerivativeMarketStatusSetProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *DerivativeMarketStatusSetProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *DerivativeMarketStatusSetProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *DerivativeMarketStatusSetProposal) ProposalType() string { + return ProposalTypeSetDerivativeMarketStatus +} + +// ValidateBasic returns ValidateBasic result of this proposal. +func (p *DerivativeMarketStatusSetProposal) ValidateBasic() error { + return gov.ValidateAbstract(p) +} + +// NewDerivativeMarketParamUpdateProposal returns new instance of DerivativeMarketParamUpdateProposal +func NewDerivativeMarketParamUpdateProposal( + title, description string, marketID string, + initialMarginRatio, maintenanceMarginRatio, + makerFeeRate, takerFeeRate, relayerFeeShareRate *sdk.Dec, +) *DerivativeMarketParamUpdateProposal { + return &DerivativeMarketParamUpdateProposal{ + title, + description, + marketID, + initialMarginRatio, + maintenanceMarginRatio, + makerFeeRate, + takerFeeRate, + relayerFeeShareRate, + } +} + +// Implements Proposal Interface +var _ gov.Content = &DerivativeMarketParamUpdateProposal{} + +// GetTitle returns the title of this proposal +func (p *DerivativeMarketParamUpdateProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal +func (p *DerivativeMarketParamUpdateProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *DerivativeMarketParamUpdateProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *DerivativeMarketParamUpdateProposal) ProposalType() string { + return ProposalTypeDerivativeMarketParamUpdate +} + +// ValidateBasic returns ValidateBasic result of this proposal. +func (p *DerivativeMarketParamUpdateProposal) ValidateBasic() error { + + if p.MakerFeeRate != nil { + if err := ValidateFee(p.MakerFeeRate); err != nil { + return err + } + } + if p.TakerFeeRate != nil { + if err := ValidateFee(p.TakerFeeRate); err != nil { + return err + } + } + + if p.RelayerFeeShareRate != nil { + if err := ValidateFee(p.RelayerFeeShareRate); err != nil { + return err + } + } + + if p.InitialMarginRatio != nil { + if err := ValidateMarginRatio(p.InitialMarginRatio); err != nil { + return err + } + } + if p.MaintenanceMarginRatio != nil { + if err := ValidateMarginRatio(p.MaintenanceMarginRatio); err != nil { + return err + } + } + + if p.MakerFeeRate != nil && p.TakerFeeRate != nil { + if p.MakerFeeRate.GT(*p.TakerFeeRate) { + return errors.New("MakerFeeRate cannot be greater than TakerFeeRate") + } + } + + if p.MaintenanceMarginRatio != nil && p.InitialMarginRatio != nil { + if p.InitialMarginRatio.LT(*p.MaintenanceMarginRatio) { + return errors.New("MaintenanceMarginRatio cannot be greater than InitialMarginRatio") + } + } + + return gov.ValidateAbstract(p) +} + +// NewPerpetualMarketLaunchProposal returns new instance of PerpetualMarketLaunchProposal +func NewPerpetualMarketLaunchProposal(title, description, ticker, baseDenom, oracle string) *PerpetualMarketLaunchProposal { + return &PerpetualMarketLaunchProposal{ + title, description, ticker, baseDenom, oracle, + } +} + +// Implements Proposal Interface +var _ gov.Content = &PerpetualMarketLaunchProposal{} + +// GetTitle returns the title of this proposal. +func (p *PerpetualMarketLaunchProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *PerpetualMarketLaunchProposal) GetDescription() string { + return p.Description +} + +// ProposalRoute returns router key of this proposal. +func (p *PerpetualMarketLaunchProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns proposal type of this proposal. +func (p *PerpetualMarketLaunchProposal) ProposalType() string { + return ProposalTypePerpetualMarketLaunch +} + +// ValidateBasic returns ValidateBasic result of a perpetual market launch proposal. +func (p *PerpetualMarketLaunchProposal) ValidateBasic() error { + if err := types.ValidateDenom(p.QuoteDenom); err != nil { + return err + } + return gov.ValidateAbstract(p) +} + +// NewExpiryFuturesMarketLaunchProposal returns new instance of ExpiryFuturesMarketLaunchProposal +func NewExpiryFuturesMarketLaunchProposal(title, description, ticker, baseDenom, oracle string, expiry int64) *ExpiryFuturesMarketLaunchProposal { + return &ExpiryFuturesMarketLaunchProposal{ + title, description, ticker, baseDenom, oracle, expiry, + } +} + +// Implements Proposal Interface +var _ gov.Content = &ExpiryFuturesMarketLaunchProposal{} + +// GetTitle returns the title of this proposal. +func (p *ExpiryFuturesMarketLaunchProposal) GetTitle() string { + return p.Title +} + +// GetDescription returns the description of this proposal. +func (p *ExpiryFuturesMarketLaunchProposal) GetDescription() string { + return p.Description +} -// ProposalRoute returns router key for this proposal -func (rh *RegisterExchangeProposal) ProposalRoute() string { return RouterKey } +// ProposalRoute returns router key of this proposal. +func (p *ExpiryFuturesMarketLaunchProposal) ProposalRoute() string { return RouterKey } -// ProposalType returns proposal type for this proposal -func (rh *RegisterExchangeProposal) ProposalType() string { - return ProposalTypeRegisterExchange +// ProposalType returns proposal type of this proposal. +func (p *ExpiryFuturesMarketLaunchProposal) ProposalType() string { + return ProposalTypeExpiryFuturesMarketLaunch } -// ValidateBasic returns ValidateBasic result for this proposal -func (rh *RegisterExchangeProposal) ValidateBasic() error { - if !common.IsHexAddress(rh.ExchangeAddress) { - return fmt.Errorf("invalid hub address: %s", rh.ExchangeAddress) +// ValidateBasic returns ValidateBasic result of a perpetual market launch proposal. +func (p *ExpiryFuturesMarketLaunchProposal) ValidateBasic() error { + if err := types.ValidateDenom(p.QuoteDenom); err != nil { + return err } - return gov.ValidateAbstract(rh) + return gov.ValidateAbstract(p) } diff --git a/chain/exchange/types/proposal.pb.go b/chain/exchange/types/proposal.pb.go deleted file mode 100644 index f4b26a0d..00000000 --- a/chain/exchange/types/proposal.pb.go +++ /dev/null @@ -1,458 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/exchange/v1beta1/proposal.proto - -package types - -import ( - fmt "fmt" - _ "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 - -// RegisterExchangeProposal is a gov Content type to register the Injective Exchange address -type RegisterExchangeProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExchangeAddress string `protobuf:"bytes,3,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty" yaml:"exchange_address"` -} - -func (m *RegisterExchangeProposal) Reset() { *m = RegisterExchangeProposal{} } -func (m *RegisterExchangeProposal) String() string { return proto.CompactTextString(m) } -func (*RegisterExchangeProposal) ProtoMessage() {} -func (*RegisterExchangeProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_32e9ec9b6b22477c, []int{0} -} -func (m *RegisterExchangeProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RegisterExchangeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RegisterExchangeProposal.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 *RegisterExchangeProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterExchangeProposal.Merge(m, src) -} -func (m *RegisterExchangeProposal) XXX_Size() int { - return m.Size() -} -func (m *RegisterExchangeProposal) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterExchangeProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterExchangeProposal proto.InternalMessageInfo - -func (m *RegisterExchangeProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *RegisterExchangeProposal) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *RegisterExchangeProposal) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -func init() { - proto.RegisterType((*RegisterExchangeProposal)(nil), "injective.exchange.v1beta1.RegisterExchangeProposal") -} - -func init() { - proto.RegisterFile("injective/exchange/v1beta1/proposal.proto", fileDescriptor_32e9ec9b6b22477c) -} - -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 { - if that == nil { - return this == nil - } - - that1, ok := that.(*RegisterExchangeProposal) - if !ok { - that2, ok := that.(RegisterExchangeProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.ExchangeAddress != that1.ExchangeAddress { - return false - } - return true -} -func (m *RegisterExchangeProposal) 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 *RegisterExchangeProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RegisterExchangeProposal) 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 = encodeVarintProposal(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { - offset -= sovProposal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RegisterExchangeProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func sovProposal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProposal(x uint64) (n int) { - return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RegisterExchangeProposal) 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 ErrIntOverflowProposal - } - 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: RegisterExchangeProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RegisterExchangeProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProposal(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, ErrIntOverflowProposal - } - 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, ErrIntOverflowProposal - } - 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, ErrIntOverflowProposal - } - 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, ErrInvalidLengthProposal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProposal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProposal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/chain/exchange/types/querier.go b/chain/exchange/types/querier.go deleted file mode 100644 index 6736bda6..00000000 --- a/chain/exchange/types/querier.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -type OrderCollectionType string - -const ( - OrderCollectionAny OrderCollectionType = "" - OrderCollectionActive OrderCollectionType = "active" - OrderCollectionArchive OrderCollectionType = "archive" -) diff --git a/chain/exchange/types/query.pb.go b/chain/exchange/types/query.pb.go index 6325568e..4f3efd90 100644 --- a/chain/exchange/types/query.pb.go +++ b/chain/exchange/types/query.pb.go @@ -111,37 +111,23 @@ func (m *QueryExchangeParamsResponse) GetParams() Params { return Params{} } -// QueryDerivativeOrdersQuoteRequest defines the request type for -// Query/derivativeOrdersQuote RPC method. -type QueryDerivativeOrdersQuoteRequest struct { - // The exchange address for the orders - ExchangeAddress string `protobuf:"bytes,1,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` - // The desired marketID of the derivative orders to fill - MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - // The desired quantity of derivative orders to fill - Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` - // True if the desired direction of the derivative orders quotes you want is long. - IsLong bool `protobuf:"varint,4,opt,name=isLong,proto3" json:"isLong,omitempty"` - // Optional maker address of trader requesting the quote (to filter out the - // trader's own orders) - MakerAddress string `protobuf:"bytes,5,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // Optional price bound. If isLong, filters out orders whose price is less than the price bound - // If !isLong, filters out orders whose price is greater than the price bound - FilterPriceBound string `protobuf:"bytes,6,opt,name=filter_price_bound,json=filterPriceBound,proto3" json:"filter_price_bound,omitempty"` -} - -func (m *QueryDerivativeOrdersQuoteRequest) Reset() { *m = QueryDerivativeOrdersQuoteRequest{} } -func (m *QueryDerivativeOrdersQuoteRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersQuoteRequest) ProtoMessage() {} -func (*QueryDerivativeOrdersQuoteRequest) Descriptor() ([]byte, []int) { +// QuerySubaccountDepositsRequest is the request type for the Query/SubaccountDeposits RPC method. +type QuerySubaccountDepositsRequest struct { + SubaccountId string `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` +} + +func (m *QuerySubaccountDepositsRequest) Reset() { *m = QuerySubaccountDepositsRequest{} } +func (m *QuerySubaccountDepositsRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySubaccountDepositsRequest) ProtoMessage() {} +func (*QuerySubaccountDepositsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{2} } -func (m *QueryDerivativeOrdersQuoteRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySubaccountDepositsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrdersQuoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySubaccountDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersQuoteRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySubaccountDepositsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -151,79 +137,42 @@ func (m *QueryDerivativeOrdersQuoteRequest) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryDerivativeOrdersQuoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersQuoteRequest.Merge(m, src) +func (m *QuerySubaccountDepositsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubaccountDepositsRequest.Merge(m, src) } -func (m *QueryDerivativeOrdersQuoteRequest) XXX_Size() int { +func (m *QuerySubaccountDepositsRequest) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrdersQuoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersQuoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeOrdersQuoteRequest proto.InternalMessageInfo - -func (m *QueryDerivativeOrdersQuoteRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -func (m *QueryDerivativeOrdersQuoteRequest) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" -} - -func (m *QueryDerivativeOrdersQuoteRequest) GetQuantity() string { - if m != nil { - return m.Quantity - } - return "" -} - -func (m *QueryDerivativeOrdersQuoteRequest) GetIsLong() bool { - if m != nil { - return m.IsLong - } - return false +func (m *QuerySubaccountDepositsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubaccountDepositsRequest.DiscardUnknown(m) } -func (m *QueryDerivativeOrdersQuoteRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} +var xxx_messageInfo_QuerySubaccountDepositsRequest proto.InternalMessageInfo -func (m *QueryDerivativeOrdersQuoteRequest) GetFilterPriceBound() string { +func (m *QuerySubaccountDepositsRequest) GetSubaccountId() string { if m != nil { - return m.FilterPriceBound + return m.SubaccountId } return "" } -// QueryDerivativeOrdersQuoteResponse defines the response type for -// Query/derivativeOrdersQuote RPC method. -type QueryDerivativeOrdersQuoteResponse struct { - // The derivative orders quotes for the taker - Quotes []*OrderQuote `protobuf:"bytes,1,rep,name=quotes,proto3" json:"quotes,omitempty"` +// QuerySubaccountDepositsResponse is the response type for the Query/SubaccountDeposits RPC method. +type QuerySubaccountDepositsResponse struct { + Deposits map[string]*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *QueryDerivativeOrdersQuoteResponse) Reset() { *m = QueryDerivativeOrdersQuoteResponse{} } -func (m *QueryDerivativeOrdersQuoteResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersQuoteResponse) ProtoMessage() {} -func (*QueryDerivativeOrdersQuoteResponse) Descriptor() ([]byte, []int) { +func (m *QuerySubaccountDepositsResponse) Reset() { *m = QuerySubaccountDepositsResponse{} } +func (m *QuerySubaccountDepositsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySubaccountDepositsResponse) ProtoMessage() {} +func (*QuerySubaccountDepositsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{3} } -func (m *QueryDerivativeOrdersQuoteResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySubaccountDepositsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrdersQuoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySubaccountDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersQuoteResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySubaccountDepositsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -233,45 +182,43 @@ func (m *QueryDerivativeOrdersQuoteResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QueryDerivativeOrdersQuoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersQuoteResponse.Merge(m, src) +func (m *QuerySubaccountDepositsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubaccountDepositsResponse.Merge(m, src) } -func (m *QueryDerivativeOrdersQuoteResponse) XXX_Size() int { +func (m *QuerySubaccountDepositsResponse) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrdersQuoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersQuoteResponse.DiscardUnknown(m) +func (m *QuerySubaccountDepositsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubaccountDepositsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrdersQuoteResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySubaccountDepositsResponse proto.InternalMessageInfo -func (m *QueryDerivativeOrdersQuoteResponse) GetQuotes() []*OrderQuote { +func (m *QuerySubaccountDepositsResponse) GetDeposits() map[string]*Deposit { if m != nil { - return m.Quotes + return m.Deposits } return nil } -// QueryDerivativeOrdersQuoteBatchRequest defines the request type for -// Query/derivativeOrdersBatchQuote RPC method. -type QueryDerivativeOrdersQuoteBatchRequest struct { - QuoteRequests []*QueryDerivativeOrdersQuoteRequest `protobuf:"bytes,1,rep,name=quote_requests,json=quoteRequests,proto3" json:"quote_requests,omitempty"` +// QuerySubaccountDepositsRequest is the request type for the Query/SubaccountDeposits RPC method. +type QuerySubaccountDepositRequest struct { + SubaccountId string `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` } -func (m *QueryDerivativeOrdersQuoteBatchRequest) Reset() { - *m = QueryDerivativeOrdersQuoteBatchRequest{} -} -func (m *QueryDerivativeOrdersQuoteBatchRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersQuoteBatchRequest) ProtoMessage() {} -func (*QueryDerivativeOrdersQuoteBatchRequest) Descriptor() ([]byte, []int) { +func (m *QuerySubaccountDepositRequest) Reset() { *m = QuerySubaccountDepositRequest{} } +func (m *QuerySubaccountDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySubaccountDepositRequest) ProtoMessage() {} +func (*QuerySubaccountDepositRequest) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{4} } -func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySubaccountDepositRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySubaccountDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersQuoteBatchRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySubaccountDepositRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -281,46 +228,49 @@ func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Marshal(b []byte, determini return b[:n], nil } } -func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersQuoteBatchRequest.Merge(m, src) +func (m *QuerySubaccountDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubaccountDepositRequest.Merge(m, src) } -func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Size() int { +func (m *QuerySubaccountDepositRequest) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersQuoteBatchRequest.DiscardUnknown(m) +func (m *QuerySubaccountDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubaccountDepositRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrdersQuoteBatchRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySubaccountDepositRequest proto.InternalMessageInfo -func (m *QueryDerivativeOrdersQuoteBatchRequest) GetQuoteRequests() []*QueryDerivativeOrdersQuoteRequest { +func (m *QuerySubaccountDepositRequest) GetSubaccountId() string { if m != nil { - return m.QuoteRequests + return m.SubaccountId } - return nil + return "" } -// QueryDerivativeOrdersQuoteBatchResponse defines the response type for -// Query/derivativeOrdersBatchQuote RPC method. -type QueryDerivativeOrdersQuoteBatchResponse struct { - // The derivative orders quote batch for the taker - OrderQuotes []*OrderQuoteInfo `protobuf:"bytes,1,rep,name=order_quotes,json=orderQuotes,proto3" json:"order_quotes,omitempty"` +func (m *QuerySubaccountDepositRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" } -func (m *QueryDerivativeOrdersQuoteBatchResponse) Reset() { - *m = QueryDerivativeOrdersQuoteBatchResponse{} +// QuerySubaccountDepositsResponse is the response type for the Query/SubaccountDeposits RPC method. +type QuerySubaccountDepositResponse struct { + Deposits *Deposit `protobuf:"bytes,1,opt,name=deposits,proto3" json:"deposits,omitempty"` } -func (m *QueryDerivativeOrdersQuoteBatchResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersQuoteBatchResponse) ProtoMessage() {} -func (*QueryDerivativeOrdersQuoteBatchResponse) Descriptor() ([]byte, []int) { + +func (m *QuerySubaccountDepositResponse) Reset() { *m = QuerySubaccountDepositResponse{} } +func (m *QuerySubaccountDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySubaccountDepositResponse) ProtoMessage() {} +func (*QuerySubaccountDepositResponse) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{5} } -func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySubaccountDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySubaccountDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersQuoteBatchResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySubaccountDepositResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -330,47 +280,43 @@ func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Marshal(b []byte, determin return b[:n], nil } } -func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersQuoteBatchResponse.Merge(m, src) +func (m *QuerySubaccountDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubaccountDepositResponse.Merge(m, src) } -func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Size() int { +func (m *QuerySubaccountDepositResponse) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersQuoteBatchResponse.DiscardUnknown(m) +func (m *QuerySubaccountDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubaccountDepositResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrdersQuoteBatchResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySubaccountDepositResponse proto.InternalMessageInfo -func (m *QueryDerivativeOrdersQuoteBatchResponse) GetOrderQuotes() []*OrderQuoteInfo { +func (m *QuerySubaccountDepositResponse) GetDeposits() *Deposit { if m != nil { - return m.OrderQuotes + return m.Deposits } return nil } -// QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest defines the request type for -// Query/derivativeOrderbookDepthBatchAvgWeightedPriceRequest RPC method. -type QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest struct { - QuoteRequests []*QueryDerivativeOrdersQuoteRequest `protobuf:"bytes,1,rep,name=quote_requests,json=quoteRequests,proto3" json:"quote_requests,omitempty"` +// QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC method. +type QuerySpotMarketsRequest struct { + // Status of the market + Status MarketStatus `protobuf:"varint,1,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) Reset() { - *m = QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest{} -} -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) ProtoMessage() {} -func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) Descriptor() ([]byte, []int) { +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{6} } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -380,48 +326,42 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Marshal( return b[:n], nil } } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest.Merge(m, src) +func (m *QuerySpotMarketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketsRequest.Merge(m, src) } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Size() int { +func (m *QuerySpotMarketsRequest) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest.DiscardUnknown(m) +func (m *QuerySpotMarketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketsRequest proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) GetQuoteRequests() []*QueryDerivativeOrdersQuoteRequest { +func (m *QuerySpotMarketsRequest) GetStatus() MarketStatus { if m != nil { - return m.QuoteRequests + return m.Status } - return nil + return MarketStatus_Active } -// QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse defines the response type for -// Query/derivativeOrdersBatchQuote RPC method. -type QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse struct { - // The average weighted price for the given amount of market depth - AvgWeightedPrice []string `protobuf:"bytes,1,rep,name=avg_weighted_price,json=avgWeightedPrice,proto3" json:"avg_weighted_price,omitempty"` +// QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC method. +type QuerySpotMarketsResponse struct { + Markets []*SpotMarket `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty"` } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) Reset() { - *m = QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse{} -} -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) ProtoMessage() {} -func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) Descriptor() ([]byte, []int) { +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{7} } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -431,47 +371,43 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Marshal return b[:n], nil } } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse.Merge(m, src) +func (m *QuerySpotMarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketsResponse.Merge(m, src) } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Size() int { +func (m *QuerySpotMarketsResponse) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse.DiscardUnknown(m) +func (m *QuerySpotMarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketsResponse proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) GetAvgWeightedPrice() []string { +func (m *QuerySpotMarketsResponse) GetMarkets() []*SpotMarket { if m != nil { - return m.AvgWeightedPrice + return m.Markets } return nil } -// QueryDerivativeOrderbookDepthAvgWeightedPriceRequest defines the request type for -// Query/derivativeOrderbookDepthAvgWeightedPriceRequest RPC method. -type QueryDerivativeOrderbookDepthAvgWeightedPriceRequest struct { - QuoteRequest *QueryDerivativeOrdersQuoteRequest `protobuf:"bytes,1,opt,name=quote_request,json=quoteRequest,proto3" json:"quote_request,omitempty"` +// QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC method. +type QuerySpotMarketRequest struct { + // Market ID for the market + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) Reset() { - *m = QueryDerivativeOrderbookDepthAvgWeightedPriceRequest{} -} -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) ProtoMessage() {} -func (*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) Descriptor() ([]byte, []int) { +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{8} } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -481,48 +417,42 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Marshal(b []b return b[:n], nil } } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceRequest.Merge(m, src) +func (m *QuerySpotMarketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketRequest.Merge(m, src) } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Size() int { +func (m *QuerySpotMarketRequest) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceRequest.DiscardUnknown(m) +func (m *QuerySpotMarketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketRequest proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) GetQuoteRequest() *QueryDerivativeOrdersQuoteRequest { +func (m *QuerySpotMarketRequest) GetMarketId() string { if m != nil { - return m.QuoteRequest + return m.MarketId } - return nil + return "" } -// QueryDerivativeOrderbookDepthAvgWeightedPriceResponse defines the response type for -// Query/derivativeOrderbookDepthAvgWeightedPrice RPC method. -type QueryDerivativeOrderbookDepthAvgWeightedPriceResponse struct { - // The average weighted price for the given amount of market depth - AvgWeightedPrice string `protobuf:"bytes,1,opt,name=avg_weighted_price,json=avgWeightedPrice,proto3" json:"avg_weighted_price,omitempty"` +// QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC method. +type QuerySpotMarketResponse struct { + Market *SpotMarket `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) Reset() { - *m = QueryDerivativeOrderbookDepthAvgWeightedPriceResponse{} -} -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) ProtoMessage() {} -func (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) Descriptor() ([]byte, []int) { +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{9} } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -532,50 +462,43 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Marshal(b [] return b[:n], nil } } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceResponse.Merge(m, src) +func (m *QuerySpotMarketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketResponse.Merge(m, src) } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Size() int { +func (m *QuerySpotMarketResponse) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceResponse.DiscardUnknown(m) +func (m *QuerySpotMarketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookDepthAvgWeightedPriceResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketResponse proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) GetAvgWeightedPrice() string { +func (m *QuerySpotMarketResponse) GetMarket() *SpotMarket { if m != nil { - return m.AvgWeightedPrice + return m.Market } - return "" + return nil } -// QuerySubaccountMarginHoldResponse defines the request type for -// Query/subaccountMarginHold RPC method. -type QuerySubaccountMarginHoldRequest struct { - // The maker_address of the trader - MakerAddress string `protobuf:"bytes,1,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // The subaccount nonce of the trader - TakerFee string `protobuf:"bytes,2,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - // The baseCurrency address to check - BaseCurrency string `protobuf:"bytes,3,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` - // The subaccountID to check - SubaccountID string `protobuf:"bytes,4,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` +// QueryDerivativeMarketsRequest is the request type for the Query/DerivativeMarkets RPC method. +type QueryDerivativeMarketsRequest struct { + // Status of the market + Status MarketStatus `protobuf:"varint,1,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` } -func (m *QuerySubaccountMarginHoldRequest) Reset() { *m = QuerySubaccountMarginHoldRequest{} } -func (m *QuerySubaccountMarginHoldRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySubaccountMarginHoldRequest) ProtoMessage() {} -func (*QuerySubaccountMarginHoldRequest) Descriptor() ([]byte, []int) { +func (m *QueryDerivativeMarketsRequest) Reset() { *m = QueryDerivativeMarketsRequest{} } +func (m *QueryDerivativeMarketsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDerivativeMarketsRequest) ProtoMessage() {} +func (*QueryDerivativeMarketsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{10} } -func (m *QuerySubaccountMarginHoldRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryDerivativeMarketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QuerySubaccountMarginHoldRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDerivativeMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QuerySubaccountMarginHoldRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDerivativeMarketsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -585,65 +508,42 @@ func (m *QuerySubaccountMarginHoldRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QuerySubaccountMarginHoldRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarginHoldRequest.Merge(m, src) +func (m *QueryDerivativeMarketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDerivativeMarketsRequest.Merge(m, src) } -func (m *QuerySubaccountMarginHoldRequest) XXX_Size() int { +func (m *QueryDerivativeMarketsRequest) XXX_Size() int { return m.Size() } -func (m *QuerySubaccountMarginHoldRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarginHoldRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubaccountMarginHoldRequest proto.InternalMessageInfo - -func (m *QuerySubaccountMarginHoldRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} - -func (m *QuerySubaccountMarginHoldRequest) GetTakerFee() string { - if m != nil { - return m.TakerFee - } - return "" +func (m *QueryDerivativeMarketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDerivativeMarketsRequest.DiscardUnknown(m) } -func (m *QuerySubaccountMarginHoldRequest) GetBaseCurrency() string { - if m != nil { - return m.BaseCurrency - } - return "" -} +var xxx_messageInfo_QueryDerivativeMarketsRequest proto.InternalMessageInfo -func (m *QuerySubaccountMarginHoldRequest) GetSubaccountID() string { +func (m *QueryDerivativeMarketsRequest) GetStatus() MarketStatus { if m != nil { - return m.SubaccountID + return m.Status } - return "" + return MarketStatus_Active } -// QuerySubaccountMarginHoldResponse defines the response type for -// Query/subaccountMarginHold RPC method. -type QuerySubaccountMarginHoldResponse struct { - // The derivative orders quotes for the taker - MarginHold string `protobuf:"bytes,1,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` +// QueryDerivativeMarketsResponse is the response type for the Query/DerivativeMarkets RPC method. +type QueryDerivativeMarketsResponse struct { + Markets []*DerivativeMarket `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty"` } -func (m *QuerySubaccountMarginHoldResponse) Reset() { *m = QuerySubaccountMarginHoldResponse{} } -func (m *QuerySubaccountMarginHoldResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySubaccountMarginHoldResponse) ProtoMessage() {} -func (*QuerySubaccountMarginHoldResponse) Descriptor() ([]byte, []int) { +func (m *QueryDerivativeMarketsResponse) Reset() { *m = QueryDerivativeMarketsResponse{} } +func (m *QueryDerivativeMarketsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDerivativeMarketsResponse) ProtoMessage() {} +func (*QueryDerivativeMarketsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{11} } -func (m *QuerySubaccountMarginHoldResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryDerivativeMarketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QuerySubaccountMarginHoldResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDerivativeMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QuerySubaccountMarginHoldResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDerivativeMarketsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -653,44 +553,43 @@ func (m *QuerySubaccountMarginHoldResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *QuerySubaccountMarginHoldResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarginHoldResponse.Merge(m, src) +func (m *QueryDerivativeMarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDerivativeMarketsResponse.Merge(m, src) } -func (m *QuerySubaccountMarginHoldResponse) XXX_Size() int { +func (m *QueryDerivativeMarketsResponse) XXX_Size() int { return m.Size() } -func (m *QuerySubaccountMarginHoldResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarginHoldResponse.DiscardUnknown(m) +func (m *QueryDerivativeMarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDerivativeMarketsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QuerySubaccountMarginHoldResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryDerivativeMarketsResponse proto.InternalMessageInfo -func (m *QuerySubaccountMarginHoldResponse) GetMarginHold() string { +func (m *QueryDerivativeMarketsResponse) GetMarkets() []*DerivativeMarket { if m != nil { - return m.MarginHold + return m.Markets } - return "" + return nil } -// QueryDerivativeOrderbookRequest defines the request type for -// Query/derivativeOrderbook RPC method. -type QueryDerivativeOrderbookRequest struct { - // The marketIDs of the orderbook to obtain +// QueryDerivativeMarketRequest is the request type for the Query/DerivativeMarket RPC method. +type QueryDerivativeMarketRequest struct { + // Market ID for the market MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` } -func (m *QueryDerivativeOrderbookRequest) Reset() { *m = QueryDerivativeOrderbookRequest{} } -func (m *QueryDerivativeOrderbookRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrderbookRequest) ProtoMessage() {} -func (*QueryDerivativeOrderbookRequest) Descriptor() ([]byte, []int) { +func (m *QueryDerivativeMarketRequest) Reset() { *m = QueryDerivativeMarketRequest{} } +func (m *QueryDerivativeMarketRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDerivativeMarketRequest) ProtoMessage() {} +func (*QueryDerivativeMarketRequest) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{12} } -func (m *QueryDerivativeOrderbookRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryDerivativeMarketRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDerivativeMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDerivativeMarketRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -700,46 +599,42 @@ func (m *QueryDerivativeOrderbookRequest) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *QueryDerivativeOrderbookRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookRequest.Merge(m, src) +func (m *QueryDerivativeMarketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDerivativeMarketRequest.Merge(m, src) } -func (m *QueryDerivativeOrderbookRequest) XXX_Size() int { +func (m *QueryDerivativeMarketRequest) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookRequest.DiscardUnknown(m) +func (m *QueryDerivativeMarketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDerivativeMarketRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryDerivativeMarketRequest proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookRequest) GetMarketId() string { +func (m *QueryDerivativeMarketRequest) GetMarketId() string { if m != nil { return m.MarketId } return "" } -// QueryDerivativeOrderbookResponse defines the response type for -// Query/derivativeOrderbook RPC method. -type QueryDerivativeOrderbookResponse struct { - // The shorts price levels - Shorts []*PriceLevel `protobuf:"bytes,1,rep,name=shorts,proto3" json:"shorts,omitempty"` - // The longs price levels - Longs []*PriceLevel `protobuf:"bytes,2,rep,name=longs,proto3" json:"longs,omitempty"` +// QueryDerivativeMarketResponse is the response type for the Query/DerivativeMarket RPC method. +type QueryDerivativeMarketResponse struct { + Market *DerivativeMarket `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` } -func (m *QueryDerivativeOrderbookResponse) Reset() { *m = QueryDerivativeOrderbookResponse{} } -func (m *QueryDerivativeOrderbookResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrderbookResponse) ProtoMessage() {} -func (*QueryDerivativeOrderbookResponse) Descriptor() ([]byte, []int) { +func (m *QueryDerivativeMarketResponse) Reset() { *m = QueryDerivativeMarketResponse{} } +func (m *QueryDerivativeMarketResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDerivativeMarketResponse) ProtoMessage() {} +func (*QueryDerivativeMarketResponse) Descriptor() ([]byte, []int) { return fileDescriptor_523db28b8af54781, []int{13} } -func (m *QueryDerivativeOrderbookResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryDerivativeMarketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryDerivativeOrderbookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDerivativeMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryDerivativeOrderbookResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDerivativeMarketResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -749,9876 +644,1088 @@ func (m *QueryDerivativeOrderbookResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *QueryDerivativeOrderbookResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrderbookResponse.Merge(m, src) +func (m *QueryDerivativeMarketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDerivativeMarketResponse.Merge(m, src) } -func (m *QueryDerivativeOrderbookResponse) XXX_Size() int { +func (m *QueryDerivativeMarketResponse) XXX_Size() int { return m.Size() } -func (m *QueryDerivativeOrderbookResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrderbookResponse.DiscardUnknown(m) +func (m *QueryDerivativeMarketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDerivativeMarketResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryDerivativeOrderbookResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryDerivativeMarketResponse proto.InternalMessageInfo -func (m *QueryDerivativeOrderbookResponse) GetShorts() []*PriceLevel { +func (m *QueryDerivativeMarketResponse) GetMarket() *DerivativeMarket { if m != nil { - return m.Shorts + return m.Market } return nil } -func (m *QueryDerivativeOrderbookResponse) GetLongs() []*PriceLevel { - if m != nil { - return m.Longs - } - return nil +func init() { + proto.RegisterType((*QueryExchangeParamsRequest)(nil), "injective.exchange.v1beta1.QueryExchangeParamsRequest") + proto.RegisterType((*QueryExchangeParamsResponse)(nil), "injective.exchange.v1beta1.QueryExchangeParamsResponse") + proto.RegisterType((*QuerySubaccountDepositsRequest)(nil), "injective.exchange.v1beta1.QuerySubaccountDepositsRequest") + proto.RegisterType((*QuerySubaccountDepositsResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountDepositsResponse") + proto.RegisterMapType((map[string]*Deposit)(nil), "injective.exchange.v1beta1.QuerySubaccountDepositsResponse.DepositsEntry") + proto.RegisterType((*QuerySubaccountDepositRequest)(nil), "injective.exchange.v1beta1.QuerySubaccountDepositRequest") + proto.RegisterType((*QuerySubaccountDepositResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountDepositResponse") + proto.RegisterType((*QuerySpotMarketsRequest)(nil), "injective.exchange.v1beta1.QuerySpotMarketsRequest") + proto.RegisterType((*QuerySpotMarketsResponse)(nil), "injective.exchange.v1beta1.QuerySpotMarketsResponse") + proto.RegisterType((*QuerySpotMarketRequest)(nil), "injective.exchange.v1beta1.QuerySpotMarketRequest") + proto.RegisterType((*QuerySpotMarketResponse)(nil), "injective.exchange.v1beta1.QuerySpotMarketResponse") + proto.RegisterType((*QueryDerivativeMarketsRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketsRequest") + proto.RegisterType((*QueryDerivativeMarketsResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketsResponse") + proto.RegisterType((*QueryDerivativeMarketRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketRequest") + proto.RegisterType((*QueryDerivativeMarketResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketResponse") } -// QueryMarginInfoRequest defines the request type for -// Query/marginInfo RPC method. -type QueryMarginInfoRequest struct { - // The maker_address of the trader - MakerAddress string `protobuf:"bytes,1,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // The subaccount nonce of the trader - TakerFee string `protobuf:"bytes,2,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - SubaccountID string `protobuf:"bytes,3,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` - BaseCurrency string `protobuf:"bytes,4,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` - ExchangeAddress string `protobuf:"bytes,5,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +func init() { + proto.RegisterFile("injective/exchange/v1beta1/query.proto", fileDescriptor_523db28b8af54781) } -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_523db28b8af54781, []int{14} -} -func (m *QueryMarginInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMarginInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMarginInfoRequest.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 *QueryMarginInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMarginInfoRequest.Merge(m, src) -} -func (m *QueryMarginInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryMarginInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMarginInfoRequest.DiscardUnknown(m) +var fileDescriptor_523db28b8af54781 = []byte{ + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4f, 0x4f, 0xdb, 0x48, + 0x18, 0xc6, 0x63, 0x58, 0xb2, 0xf0, 0xb2, 0xac, 0x60, 0x16, 0xed, 0x46, 0x81, 0x0d, 0xc8, 0x48, + 0x28, 0x8b, 0x58, 0x1b, 0x02, 0x1b, 0x48, 0x40, 0x80, 0x10, 0xac, 0x14, 0x69, 0xb7, 0x6a, 0xcd, + 0xa9, 0xb4, 0x12, 0x9d, 0x24, 0xa3, 0xc4, 0x85, 0x78, 0x4c, 0x6c, 0x47, 0x8d, 0xaa, 0x5e, 0xfa, + 0x09, 0x2a, 0xf5, 0x5b, 0xf4, 0xda, 0x5b, 0x8f, 0x3d, 0xa1, 0x56, 0xaa, 0x90, 0x7a, 0xe1, 0x54, + 0x55, 0xd0, 0x53, 0x3f, 0x45, 0x95, 0x99, 0xb1, 0x0d, 0xf9, 0x63, 0xec, 0xb4, 0x37, 0x7b, 0x3c, + 0xcf, 0xf3, 0xfe, 0x9e, 0x77, 0x86, 0x97, 0xc0, 0xbc, 0x6e, 0x3c, 0x26, 0x25, 0x5b, 0x6f, 0x10, + 0x95, 0x3c, 0x29, 0x55, 0xb1, 0x51, 0x21, 0x6a, 0x63, 0xb9, 0x48, 0x6c, 0xbc, 0xac, 0x9e, 0x3a, + 0xa4, 0xde, 0x54, 0xcc, 0x3a, 0xb5, 0x29, 0x4a, 0x7a, 0xfb, 0x14, 0x77, 0x9f, 0x22, 0xf6, 0x25, + 0xa7, 0x2b, 0x94, 0x56, 0x4e, 0x88, 0x8a, 0x4d, 0x5d, 0xc5, 0x86, 0x41, 0x6d, 0x6c, 0xeb, 0xd4, + 0xb0, 0xb8, 0x32, 0xf9, 0x57, 0x40, 0x05, 0xcf, 0x8a, 0x6f, 0x9d, 0xac, 0xd0, 0x0a, 0x65, 0x8f, + 0x6a, 0xeb, 0x89, 0xaf, 0xca, 0xd3, 0x90, 0xbc, 0xd7, 0x22, 0xd9, 0x17, 0x9b, 0xef, 0xe2, 0x3a, + 0xae, 0x59, 0x1a, 0x39, 0x75, 0x88, 0x65, 0xcb, 0x47, 0x30, 0xd5, 0xf5, 0xab, 0x65, 0x52, 0xc3, + 0x22, 0x68, 0x07, 0xe2, 0x26, 0x5b, 0x49, 0x48, 0xb3, 0x52, 0x7a, 0x34, 0x23, 0x2b, 0xbd, 0x83, + 0x28, 0x5c, 0xbb, 0xfb, 0xd3, 0xd9, 0xa7, 0x99, 0x98, 0x26, 0x74, 0xf2, 0x3e, 0xa4, 0x58, 0x81, + 0x03, 0xa7, 0x88, 0x4b, 0x25, 0xea, 0x18, 0xf6, 0x1e, 0x31, 0xa9, 0xa5, 0xdb, 0x2e, 0x02, 0x9a, + 0x83, 0x31, 0xcb, 0xfb, 0x78, 0xa4, 0x97, 0x59, 0xa9, 0x11, 0xed, 0x17, 0x7f, 0xb1, 0x50, 0x96, + 0xbf, 0x4a, 0x30, 0xd3, 0xd3, 0x47, 0xc0, 0x12, 0x18, 0x2e, 0x8b, 0xb5, 0x84, 0x34, 0x3b, 0x98, + 0x1e, 0xcd, 0x14, 0x82, 0x70, 0x6f, 0xb1, 0x53, 0xdc, 0x85, 0x7d, 0xc3, 0xae, 0x37, 0x35, 0xcf, + 0x3a, 0xf9, 0x08, 0xc6, 0x6e, 0x7c, 0x42, 0xe3, 0x30, 0x78, 0x4c, 0x9a, 0x02, 0xbb, 0xf5, 0x88, + 0x72, 0x30, 0xd4, 0xc0, 0x27, 0x0e, 0x49, 0x0c, 0xb0, 0xae, 0xcd, 0x05, 0x61, 0x08, 0x2f, 0x8d, + 0x2b, 0xf2, 0x03, 0xeb, 0x92, 0x7c, 0x08, 0x7f, 0x76, 0x87, 0x8b, 0xd2, 0x32, 0x34, 0x09, 0x43, + 0x65, 0x62, 0xd0, 0x1a, 0x83, 0x18, 0xd1, 0xf8, 0x8b, 0x8c, 0x7b, 0x9d, 0x87, 0xd7, 0xc6, 0xed, + 0x1b, 0x6d, 0x0c, 0xcd, 0xef, 0x89, 0xe4, 0x07, 0xf0, 0x07, 0x2f, 0x61, 0x52, 0xfb, 0x7f, 0x5c, + 0x3f, 0x26, 0xfe, 0x59, 0xef, 0x40, 0xdc, 0xb2, 0xb1, 0xed, 0x70, 0xe7, 0x5f, 0x33, 0xe9, 0x20, + 0x67, 0xae, 0x3d, 0x60, 0xfb, 0x35, 0xa1, 0x93, 0x1f, 0x42, 0xa2, 0xd3, 0xdc, 0xbb, 0xad, 0x3f, + 0xd7, 0xf8, 0x92, 0x38, 0xff, 0xf9, 0x20, 0x7b, 0xdf, 0x41, 0x73, 0x65, 0xf2, 0x3f, 0xf0, 0x7b, + 0x9b, 0xbb, 0x4b, 0x3e, 0x05, 0x23, 0x7c, 0x93, 0xdf, 0xee, 0x61, 0xbe, 0x50, 0x28, 0xcb, 0xf7, + 0x3b, 0x12, 0x7b, 0x4c, 0x5b, 0x10, 0xe7, 0xdb, 0x44, 0x2f, 0xc3, 0x22, 0x09, 0x95, 0x8c, 0xc5, + 0x5d, 0xd8, 0x23, 0x75, 0xbd, 0x81, 0x5b, 0xb2, 0x1f, 0xde, 0xd2, 0xaa, 0xb8, 0x12, 0x5d, 0x4a, + 0x88, 0x10, 0xff, 0xb6, 0x37, 0x76, 0x31, 0xf8, 0x46, 0xdc, 0xf4, 0xf1, 0xdb, 0xbb, 0x01, 0xd3, + 0x5d, 0x2b, 0x85, 0x6a, 0x32, 0xe9, 0xd1, 0x09, 0x8f, 0x72, 0xaf, 0xad, 0xd5, 0xd1, 0x20, 0x85, + 0x36, 0x73, 0x01, 0x30, 0xc4, 0xea, 0xa0, 0x37, 0x12, 0xfc, 0xd6, 0x65, 0x38, 0xa2, 0xec, 0xad, + 0x53, 0xa5, 0xeb, 0xac, 0x4d, 0xae, 0x45, 0xd6, 0xf1, 0x60, 0x72, 0xe6, 0xf9, 0xc7, 0x2f, 0x2f, + 0x07, 0x16, 0xd1, 0x82, 0x1a, 0xe2, 0x9f, 0x81, 0x80, 0xfc, 0x20, 0x01, 0xea, 0x1c, 0x6e, 0x28, + 0xdf, 0xd7, 0x44, 0xe4, 0xfc, 0x1b, 0xdf, 0x31, 0x4d, 0xe5, 0x6d, 0x96, 0x21, 0x87, 0xd6, 0xc2, + 0x64, 0x50, 0xad, 0x4e, 0xf2, 0x77, 0x12, 0x4c, 0x74, 0xf8, 0xa3, 0x5c, 0x74, 0x26, 0x37, 0x4e, + 0xbe, 0x1f, 0xa9, 0x48, 0xb3, 0xc5, 0xd2, 0xac, 0xa3, 0x6c, 0x7f, 0x69, 0xd0, 0x2b, 0x09, 0x46, + 0xaf, 0x4d, 0x30, 0xb4, 0x72, 0x3b, 0x4b, 0xc7, 0x30, 0x4d, 0xae, 0x46, 0x13, 0x09, 0xf4, 0x25, + 0x86, 0xbe, 0x80, 0xd2, 0x41, 0xe8, 0x96, 0x49, 0x6d, 0x55, 0xfc, 0xd5, 0xa2, 0xd7, 0x12, 0x80, + 0xef, 0x84, 0x32, 0x11, 0xca, 0xba, 0xa8, 0x2b, 0x91, 0x34, 0x82, 0x74, 0x93, 0x91, 0x66, 0xd1, + 0x6a, 0x58, 0x52, 0xf5, 0xa9, 0x37, 0x3d, 0x9e, 0xa1, 0xb7, 0x12, 0x4c, 0x74, 0x4c, 0xb4, 0x10, + 0xf7, 0xa5, 0xd7, 0xa0, 0x0d, 0x71, 0x5f, 0x7a, 0x0e, 0x50, 0x39, 0xcb, 0xa2, 0x2c, 0x21, 0x25, + 0x28, 0x4a, 0xd9, 0x93, 0x7b, 0xad, 0x7f, 0x2f, 0xc1, 0x78, 0xbb, 0x2b, 0x5a, 0x8f, 0x0c, 0xe2, + 0x46, 0xc8, 0xf5, 0xa1, 0x14, 0x09, 0x76, 0x59, 0x82, 0x4d, 0x94, 0x8f, 0x96, 0xe0, 0xfa, 0x91, + 0xec, 0x56, 0xcf, 0x2e, 0x53, 0xd2, 0xf9, 0x65, 0x4a, 0xfa, 0x7c, 0x99, 0x92, 0x5e, 0x5c, 0xa5, + 0x62, 0xe7, 0x57, 0xa9, 0xd8, 0xc5, 0x55, 0x2a, 0x76, 0x78, 0xa7, 0xa2, 0xdb, 0x55, 0xa7, 0xa8, + 0x94, 0x68, 0x4d, 0x2d, 0xb8, 0xfe, 0xff, 0xe1, 0xa2, 0xe5, 0x57, 0xfb, 0xbb, 0x44, 0xeb, 0xe4, + 0xfa, 0x6b, 0x15, 0xeb, 0x86, 0x5a, 0xa3, 0x65, 0xe7, 0x84, 0x58, 0x3e, 0x8a, 0xdd, 0x34, 0x89, + 0x55, 0x8c, 0xb3, 0xdf, 0xbe, 0x2b, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x09, 0x87, 0x10, 0xbe, + 0xa0, 0x0b, 0x00, 0x00, } -var xxx_messageInfo_QueryMarginInfoRequest proto.InternalMessageInfo +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn -func (m *QueryMarginInfoRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Retrieves exchange params + QueryExchangeParams(ctx context.Context, in *QueryExchangeParamsRequest, opts ...grpc.CallOption) (*QueryExchangeParamsResponse, error) + // Retrieves a Subaccount's Deposits + SubaccountDeposits(ctx context.Context, in *QuerySubaccountDepositsRequest, opts ...grpc.CallOption) (*QuerySubaccountDepositsResponse, error) + // Retrieves a Subaccount's Deposits + SubaccountDeposit(ctx context.Context, in *QuerySubaccountDepositRequest, opts ...grpc.CallOption) (*QuerySubaccountDepositResponse, error) + // Retrieves a list of spot markets. + SpotMarkets(ctx context.Context, in *QuerySpotMarketsRequest, opts ...grpc.CallOption) (*QuerySpotMarketsResponse, error) + // Retrieves a spot market by ticker + SpotMarket(ctx context.Context, in *QuerySpotMarketRequest, opts ...grpc.CallOption) (*QuerySpotMarketResponse, error) + // Retrieves a list of spot markets. + DerivativeMarkets(ctx context.Context, in *QueryDerivativeMarketsRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketsResponse, error) + // Retrieves a spot market by ticker + DerivativeMarket(ctx context.Context, in *QueryDerivativeMarketRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketResponse, error) } -func (m *QueryMarginInfoRequest) GetTakerFee() string { - if m != nil { - return m.TakerFee - } - return "" +type queryClient struct { + cc grpc1.ClientConn } -func (m *QueryMarginInfoRequest) GetSubaccountID() string { - if m != nil { - return m.SubaccountID - } - return "" +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} } -func (m *QueryMarginInfoRequest) GetBaseCurrency() string { - if m != nil { - return m.BaseCurrency - } - return "" +func (c *queryClient) QueryExchangeParams(ctx context.Context, in *QueryExchangeParamsRequest, opts ...grpc.CallOption) (*QueryExchangeParamsResponse, error) { + out := new(QueryExchangeParamsResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryExchangeParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryMarginInfoRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (c *queryClient) SubaccountDeposits(ctx context.Context, in *QuerySubaccountDepositsRequest, opts ...grpc.CallOption) (*QuerySubaccountDepositsResponse, error) { + out := new(QuerySubaccountDepositsResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/SubaccountDeposits", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -// QueryMarginInfoResponse defines the response type for -// Query/marginInfo RPC method. -type QueryMarginInfoResponse struct { - MarginInfo *MarginInfo `protobuf:"bytes,1,opt,name=margin_info,json=marginInfo,proto3" json:"margin_info,omitempty"` +func (c *queryClient) SubaccountDeposit(ctx context.Context, in *QuerySubaccountDepositRequest, opts ...grpc.CallOption) (*QuerySubaccountDepositResponse, error) { + out := new(QuerySubaccountDepositResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/SubaccountDeposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -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_523db28b8af54781, []int{15} -} -func (m *QueryMarginInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMarginInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMarginInfoResponse.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 (c *queryClient) SpotMarkets(ctx context.Context, in *QuerySpotMarketsRequest, opts ...grpc.CallOption) (*QuerySpotMarketsResponse, error) { + out := new(QuerySpotMarketsResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/SpotMarkets", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *QueryMarginInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMarginInfoResponse.Merge(m, src) -} -func (m *QueryMarginInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMarginInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMarginInfoResponse.DiscardUnknown(m) + +func (c *queryClient) SpotMarket(ctx context.Context, in *QuerySpotMarketRequest, opts ...grpc.CallOption) (*QuerySpotMarketResponse, error) { + out := new(QuerySpotMarketResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/SpotMarket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -var xxx_messageInfo_QueryMarginInfoResponse proto.InternalMessageInfo +func (c *queryClient) DerivativeMarkets(ctx context.Context, in *QueryDerivativeMarketsRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketsResponse, error) { + out := new(QueryDerivativeMarketsResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/DerivativeMarkets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} -func (m *QueryMarginInfoResponse) GetMarginInfo() *MarginInfo { - if m != nil { - return m.MarginInfo +func (c *queryClient) DerivativeMarket(ctx context.Context, in *QueryDerivativeMarketRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketResponse, error) { + out := new(QueryDerivativeMarketResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/DerivativeMarket", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -// QueryMarginInfoRequest defines the request type for -// Query/marginInfo RPC method. -type QueryPositionInfoRequest struct { - // The maker_address of the trader - MakerAddress string `protobuf:"bytes,1,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // The subaccount nonce of the trader - TakerFee string `protobuf:"bytes,2,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - SubaccountID string `protobuf:"bytes,3,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` - MarketId string `protobuf:"bytes,4,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - ExchangeAddress string `protobuf:"bytes,5,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +// QueryServer is the server API for Query service. +type QueryServer interface { + // Retrieves exchange params + QueryExchangeParams(context.Context, *QueryExchangeParamsRequest) (*QueryExchangeParamsResponse, error) + // Retrieves a Subaccount's Deposits + SubaccountDeposits(context.Context, *QuerySubaccountDepositsRequest) (*QuerySubaccountDepositsResponse, error) + // Retrieves a Subaccount's Deposits + SubaccountDeposit(context.Context, *QuerySubaccountDepositRequest) (*QuerySubaccountDepositResponse, error) + // Retrieves a list of spot markets. + SpotMarkets(context.Context, *QuerySpotMarketsRequest) (*QuerySpotMarketsResponse, error) + // Retrieves a spot market by ticker + SpotMarket(context.Context, *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) + // Retrieves a list of spot markets. + DerivativeMarkets(context.Context, *QueryDerivativeMarketsRequest) (*QueryDerivativeMarketsResponse, error) + // Retrieves a spot market by ticker + DerivativeMarket(context.Context, *QueryDerivativeMarketRequest) (*QueryDerivativeMarketResponse, error) } -func (m *QueryPositionInfoRequest) Reset() { *m = QueryPositionInfoRequest{} } -func (m *QueryPositionInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPositionInfoRequest) ProtoMessage() {} -func (*QueryPositionInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{16} +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -func (m *QueryPositionInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (*UnimplementedQueryServer) QueryExchangeParams(ctx context.Context, req *QueryExchangeParamsRequest) (*QueryExchangeParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryExchangeParams not implemented") } -func (m *QueryPositionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPositionInfoRequest.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 (*UnimplementedQueryServer) SubaccountDeposits(ctx context.Context, req *QuerySubaccountDepositsRequest) (*QuerySubaccountDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubaccountDeposits not implemented") } -func (m *QueryPositionInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPositionInfoRequest.Merge(m, src) +func (*UnimplementedQueryServer) SubaccountDeposit(ctx context.Context, req *QuerySubaccountDepositRequest) (*QuerySubaccountDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubaccountDeposit not implemented") } -func (m *QueryPositionInfoRequest) XXX_Size() int { - return m.Size() +func (*UnimplementedQueryServer) SpotMarkets(ctx context.Context, req *QuerySpotMarketsRequest) (*QuerySpotMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpotMarkets not implemented") } -func (m *QueryPositionInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPositionInfoRequest.DiscardUnknown(m) +func (*UnimplementedQueryServer) SpotMarket(ctx context.Context, req *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpotMarket not implemented") +} +func (*UnimplementedQueryServer) DerivativeMarkets(ctx context.Context, req *QueryDerivativeMarketsRequest) (*QueryDerivativeMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DerivativeMarkets not implemented") +} +func (*UnimplementedQueryServer) DerivativeMarket(ctx context.Context, req *QueryDerivativeMarketRequest) (*QueryDerivativeMarketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DerivativeMarket not implemented") } -var xxx_messageInfo_QueryPositionInfoRequest proto.InternalMessageInfo - -func (m *QueryPositionInfoRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) } -func (m *QueryPositionInfoRequest) GetTakerFee() string { - if m != nil { - return m.TakerFee +func _Query_QueryExchangeParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExchangeParamsRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(QueryServer).QueryExchangeParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/QueryExchangeParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryExchangeParams(ctx, req.(*QueryExchangeParamsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryPositionInfoRequest) GetSubaccountID() string { - if m != nil { - return m.SubaccountID +func _Query_SubaccountDeposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySubaccountDepositsRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(QueryServer).SubaccountDeposits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/SubaccountDeposits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SubaccountDeposits(ctx, req.(*QuerySubaccountDepositsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryPositionInfoRequest) GetMarketId() string { - if m != nil { - return m.MarketId +func _Query_SubaccountDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySubaccountDepositRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(QueryServer).SubaccountDeposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/SubaccountDeposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SubaccountDeposit(ctx, req.(*QuerySubaccountDepositRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryPositionInfoRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func _Query_SpotMarkets_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 } - return "" + if interceptor == nil { + return srv.(QueryServer).SpotMarkets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/SpotMarkets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpotMarkets(ctx, req.(*QuerySpotMarketsRequest)) + } + return interceptor(ctx, in, info, handler) } -// QueryMarginInfoResponse defines the response type for -// Query/marginInfo RPC method. -type QueryPositionInfoResponse struct { - PositionInfo *PositionInfo `protobuf:"bytes,1,opt,name=position_info,json=positionInfo,proto3" json:"position_info,omitempty"` +func _Query_SpotMarket_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).SpotMarket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/SpotMarket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpotMarket(ctx, req.(*QuerySpotMarketRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryPositionInfoResponse) Reset() { *m = QueryPositionInfoResponse{} } -func (m *QueryPositionInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPositionInfoResponse) ProtoMessage() {} -func (*QueryPositionInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{17} -} -func (m *QueryPositionInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPositionInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPositionInfoResponse.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 _Query_DerivativeMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDerivativeMarketsRequest) + if err := dec(in); err != nil { + return nil, err } -} -func (m *QueryPositionInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPositionInfoResponse.Merge(m, src) -} -func (m *QueryPositionInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPositionInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPositionInfoResponse.DiscardUnknown(m) + if interceptor == nil { + return srv.(QueryServer).DerivativeMarkets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/DerivativeMarkets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DerivativeMarkets(ctx, req.(*QueryDerivativeMarketsRequest)) + } + return interceptor(ctx, in, info, handler) } -var xxx_messageInfo_QueryPositionInfoResponse proto.InternalMessageInfo - -func (m *QueryPositionInfoResponse) GetPositionInfo() *PositionInfo { - if m != nil { - return m.PositionInfo +func _Query_DerivativeMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDerivativeMarketRequest) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(QueryServer).DerivativeMarket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Query/DerivativeMarket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DerivativeMarket(ctx, req.(*QueryDerivativeMarketRequest)) + } + return interceptor(ctx, in, info, handler) } -// QueryMarginInfoRequest defines the request type for -// Query/marginInfo RPC method. -type QueryTraderSubaccountsInfoRequest struct { - // The maker_address of the trader - MakerAddress string `protobuf:"bytes,1,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // The exchange addres - ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.exchange.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryExchangeParams", + Handler: _Query_QueryExchangeParams_Handler, + }, + { + MethodName: "SubaccountDeposits", + Handler: _Query_SubaccountDeposits_Handler, + }, + { + MethodName: "SubaccountDeposit", + Handler: _Query_SubaccountDeposit_Handler, + }, + { + MethodName: "SpotMarkets", + Handler: _Query_SpotMarkets_Handler, + }, + { + MethodName: "SpotMarket", + Handler: _Query_SpotMarket_Handler, + }, + { + MethodName: "DerivativeMarkets", + Handler: _Query_DerivativeMarkets_Handler, + }, + { + MethodName: "DerivativeMarket", + Handler: _Query_DerivativeMarket_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/exchange/v1beta1/query.proto", } -func (m *QueryTraderSubaccountsInfoRequest) Reset() { *m = QueryTraderSubaccountsInfoRequest{} } -func (m *QueryTraderSubaccountsInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTraderSubaccountsInfoRequest) ProtoMessage() {} -func (*QueryTraderSubaccountsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{18} -} -func (m *QueryTraderSubaccountsInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTraderSubaccountsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTraderSubaccountsInfoRequest.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 *QueryExchangeParamsRequest) 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 *QueryTraderSubaccountsInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTraderSubaccountsInfoRequest.Merge(m, src) -} -func (m *QueryTraderSubaccountsInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTraderSubaccountsInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTraderSubaccountsInfoRequest.DiscardUnknown(m) + return dAtA[:n], nil } -var xxx_messageInfo_QueryTraderSubaccountsInfoRequest proto.InternalMessageInfo +func (m *QueryExchangeParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} -func (m *QueryTraderSubaccountsInfoRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" +func (m *QueryExchangeParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } -func (m *QueryTraderSubaccountsInfoRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (m *QueryExchangeParamsResponse) 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 "" + return dAtA[:n], nil } -// QueryMarginInfoResponse defines the response type for -// Query/marginInfo RPC method. -type QueryTraderSubaccountsInfoResponse struct { - SubaccountInfo []*SubaccountInfo `protobuf:"bytes,1,rep,name=subaccount_info,json=subaccountInfo,proto3" json:"subaccount_info,omitempty"` -} - -func (m *QueryTraderSubaccountsInfoResponse) Reset() { *m = QueryTraderSubaccountsInfoResponse{} } -func (m *QueryTraderSubaccountsInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTraderSubaccountsInfoResponse) ProtoMessage() {} -func (*QueryTraderSubaccountsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{19} -} -func (m *QueryTraderSubaccountsInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *QueryExchangeParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTraderSubaccountsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTraderSubaccountsInfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + +func (m *QueryExchangeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { - return nil, err + return 0, err } - return b[:n], nil + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } -} -func (m *QueryTraderSubaccountsInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTraderSubaccountsInfoResponse.Merge(m, src) -} -func (m *QueryTraderSubaccountsInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTraderSubaccountsInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTraderSubaccountsInfoResponse.DiscardUnknown(m) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -var xxx_messageInfo_QueryTraderSubaccountsInfoResponse proto.InternalMessageInfo - -func (m *QueryTraderSubaccountsInfoResponse) GetSubaccountInfo() []*SubaccountInfo { - if m != nil { - return m.SubaccountInfo +func (m *QuerySubaccountDepositsRequest) 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 nil + return dAtA[:n], nil } -// QueryDerivativeMarketsRequest defines the request type for the -// Query/DerivativeMarkets RPC method -type QueryDerivativeMarketsRequest struct { - ExchangeAddress string `protobuf:"bytes,1,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +func (m *QuerySubaccountDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDerivativeMarketsRequest) Reset() { *m = QueryDerivativeMarketsRequest{} } -func (m *QueryDerivativeMarketsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeMarketsRequest) ProtoMessage() {} -func (*QueryDerivativeMarketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{20} -} -func (m *QueryDerivativeMarketsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeMarketsRequest.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 *QuerySubaccountDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0xa } -} -func (m *QueryDerivativeMarketsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeMarketsRequest.Merge(m, src) -} -func (m *QueryDerivativeMarketsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeMarketsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeMarketsRequest.DiscardUnknown(m) + return len(dAtA) - i, nil } -var xxx_messageInfo_QueryDerivativeMarketsRequest proto.InternalMessageInfo - -func (m *QueryDerivativeMarketsRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (m *QuerySubaccountDepositsResponse) 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 "" + return dAtA[:n], nil } -// QueryDerivativeMarketsResponse defines the response type for -// Query/DerivativeMarkets RPC method. -type QueryDerivativeMarketsResponse struct { - // Array of found derivative markets - Markets []*DerivativeMarket `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty"` +func (m *QuerySubaccountDepositsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDerivativeMarketsResponse) Reset() { *m = QueryDerivativeMarketsResponse{} } -func (m *QueryDerivativeMarketsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeMarketsResponse) ProtoMessage() {} -func (*QueryDerivativeMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{21} -} -func (m *QueryDerivativeMarketsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeMarketsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *QuerySubaccountDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposits) > 0 { + for k := range m.Deposits { + v := m.Deposits[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } - return b[:n], nil } + return len(dAtA) - i, nil } -func (m *QueryDerivativeMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeMarketsResponse.Merge(m, src) -} -func (m *QueryDerivativeMarketsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeMarketsResponse proto.InternalMessageInfo -func (m *QueryDerivativeMarketsResponse) GetMarkets() []*DerivativeMarket { - if m != nil { - return m.Markets +func (m *QuerySubaccountDepositRequest) 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 nil + return dAtA[:n], nil } -// QueryUnderMarginedAccountsRequest defines the request type for the -// Query/UnderMarginedAccounts RPC method -type QueryUnderMarginedAccountsRequest struct { - BaseCurrency string `protobuf:"bytes,1,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` - ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +func (m *QuerySubaccountDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnderMarginedAccountsRequest) Reset() { *m = QueryUnderMarginedAccountsRequest{} } -func (m *QueryUnderMarginedAccountsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryUnderMarginedAccountsRequest) ProtoMessage() {} -func (*QueryUnderMarginedAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{22} -} -func (m *QueryUnderMarginedAccountsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnderMarginedAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnderMarginedAccountsRequest.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 *QuerySubaccountDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 } -} -func (m *QueryUnderMarginedAccountsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnderMarginedAccountsRequest.Merge(m, src) -} -func (m *QueryUnderMarginedAccountsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryUnderMarginedAccountsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnderMarginedAccountsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUnderMarginedAccountsRequest proto.InternalMessageInfo - -func (m *QueryUnderMarginedAccountsRequest) GetBaseCurrency() string { - if m != nil { - return m.BaseCurrency + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0xa } - return "" + return len(dAtA) - i, nil } -func (m *QueryUnderMarginedAccountsRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (m *QuerySubaccountDepositResponse) 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 "" + return dAtA[:n], nil } -// QueryDerivativeMarketsResponse defines the response type for -// Query/DerivativeMarkets RPC method. -type QueryUnderMarginedAccountsResponse struct { - // Array of under margined accounts - Accounts []*UnderMarginedAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +func (m *QuerySubaccountDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnderMarginedAccountsResponse) Reset() { *m = QueryUnderMarginedAccountsResponse{} } -func (m *QueryUnderMarginedAccountsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryUnderMarginedAccountsResponse) ProtoMessage() {} -func (*QueryUnderMarginedAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{23} -} -func (m *QueryUnderMarginedAccountsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnderMarginedAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnderMarginedAccountsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *QuerySubaccountDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deposits != nil { + { + size, err := m.Deposits.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0xa } + return len(dAtA) - i, nil } -func (m *QueryUnderMarginedAccountsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnderMarginedAccountsResponse.Merge(m, src) -} -func (m *QueryUnderMarginedAccountsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryUnderMarginedAccountsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnderMarginedAccountsResponse.DiscardUnknown(m) + +func (m *QuerySpotMarketsRequest) 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 } -var xxx_messageInfo_QueryUnderMarginedAccountsResponse proto.InternalMessageInfo +func (m *QuerySpotMarketsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} -func (m *QueryUnderMarginedAccountsResponse) GetAccounts() []*UnderMarginedAccount { - if m != nil { - return m.Accounts +func (m *QuerySpotMarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - return nil + return len(dAtA) - i, nil } -type UnderMarginedAccount struct { - MarketName string `protobuf:"bytes,1,opt,name=market_name,json=marketName,proto3" json:"market_name,omitempty"` - MissingAmount string `protobuf:"bytes,2,opt,name=missing_amount,json=missingAmount,proto3" json:"missing_amount,omitempty"` - MarginHold string `protobuf:"bytes,3,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` - TotalDeposits string `protobuf:"bytes,4,opt,name=total_deposits,json=totalDeposits,proto3" json:"total_deposits,omitempty"` - MarketId string `protobuf:"bytes,5,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - ExchangeAddress string `protobuf:"bytes,6,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` - SubaccountId string `protobuf:"bytes,7,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` - MakerAddress string `protobuf:"bytes,8,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - Nonce string `protobuf:"bytes,9,opt,name=nonce,proto3" json:"nonce,omitempty"` - OrderHash string `protobuf:"bytes,10,opt,name=order_hash,json=orderHash,proto3" json:"order_hash,omitempty"` - IsLong bool `protobuf:"varint,11,opt,name=isLong,proto3" json:"isLong,omitempty"` - OrderPrice string `protobuf:"bytes,12,opt,name=order_price,json=orderPrice,proto3" json:"order_price,omitempty"` -} - -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_523db28b8af54781, []int{24} -} -func (m *UnderMarginedAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnderMarginedAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnderMarginedAccount.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 *QuerySpotMarketsResponse) 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 *UnderMarginedAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnderMarginedAccount.Merge(m, src) -} -func (m *UnderMarginedAccount) XXX_Size() int { - return m.Size() -} -func (m *UnderMarginedAccount) XXX_DiscardUnknown() { - xxx_messageInfo_UnderMarginedAccount.DiscardUnknown(m) + return dAtA[:n], nil } -var xxx_messageInfo_UnderMarginedAccount proto.InternalMessageInfo - -func (m *UnderMarginedAccount) GetMarketName() string { - if m != nil { - return m.MarketName - } - return "" +func (m *QuerySpotMarketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnderMarginedAccount) GetMissingAmount() string { - if m != nil { - return m.MissingAmount +func (m *QuerySpotMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Markets) > 0 { + for iNdEx := len(m.Markets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Markets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return "" + return len(dAtA) - i, nil } -func (m *UnderMarginedAccount) GetMarginHold() string { - if m != nil { - return m.MarginHold +func (m *QuerySpotMarketRequest) 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 "" + return dAtA[:n], nil } -func (m *UnderMarginedAccount) GetTotalDeposits() string { - if m != nil { - return m.TotalDeposits - } - return "" +func (m *QuerySpotMarketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnderMarginedAccount) GetMarketId() string { - if m != nil { - return m.MarketId +func (m *QuerySpotMarketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0xa } - return "" + return len(dAtA) - i, nil } -func (m *UnderMarginedAccount) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func (m *QuerySpotMarketResponse) 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 "" + return dAtA[:n], nil } -func (m *UnderMarginedAccount) GetSubaccountId() string { - if m != nil { - return m.SubaccountId - } - return "" +func (m *QuerySpotMarketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnderMarginedAccount) GetMakerAddress() string { - if m != nil { - return m.MakerAddress +func (m *QuerySpotMarketResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return "" + return len(dAtA) - i, nil } -func (m *UnderMarginedAccount) GetNonce() string { - if m != nil { - return m.Nonce +func (m *QueryDerivativeMarketsRequest) 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 "" + return dAtA[:n], nil } -func (m *UnderMarginedAccount) GetOrderHash() string { - if m != nil { - return m.OrderHash - } - return "" +func (m *QueryDerivativeMarketsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnderMarginedAccount) GetIsLong() bool { - if m != nil { - return m.IsLong +func (m *QueryDerivativeMarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - return false + return len(dAtA) - i, nil } -func (m *UnderMarginedAccount) GetOrderPrice() string { - if m != nil { - return m.OrderPrice +func (m *QueryDerivativeMarketsResponse) 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 "" + return dAtA[:n], nil } -type OrderFilters struct { - // for derivatives - ContractPriceBound string `protobuf:"bytes,1,opt,name=contract_price_bound,json=contractPriceBound,proto3" json:"contract_price_bound,omitempty"` - MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - IsLong bool `protobuf:"varint,3,opt,name=is_long,json=isLong,proto3" json:"is_long,omitempty"` - // for normal orders - NotExpired bool `protobuf:"varint,4,opt,name=not_expired,json=notExpired,proto3" json:"not_expired,omitempty"` - MakerAssetAddress string `protobuf:"bytes,5,opt,name=maker_asset_address,json=makerAssetAddress,proto3" json:"maker_asset_address,omitempty"` - TakerAssetAddress string `protobuf:"bytes,6,opt,name=taker_asset_address,json=takerAssetAddress,proto3" json:"taker_asset_address,omitempty"` - ExchangeAddress string `protobuf:"bytes,7,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` - SenderAddress string `protobuf:"bytes,8,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` - MakerAssetData string `protobuf:"bytes,9,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - TakerAssetData string `protobuf:"bytes,10,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` - MakerAssetAmount string `protobuf:"bytes,11,opt,name=maker_asset_amount,json=makerAssetAmount,proto3" json:"maker_asset_amount,omitempty"` - TakerAssetAmount string `protobuf:"bytes,12,opt,name=taker_asset_amount,json=takerAssetAmount,proto3" json:"taker_asset_amount,omitempty"` - MakerAddress string `protobuf:"bytes,13,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - NotMakerAddress string `protobuf:"bytes,14,opt,name=not_maker_address,json=notMakerAddress,proto3" json:"not_maker_address,omitempty"` - TakerAddress string `protobuf:"bytes,15,opt,name=taker_address,json=takerAddress,proto3" json:"taker_address,omitempty"` - TraderAddress string `protobuf:"bytes,16,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"` - FeeRecipientAddress string `protobuf:"bytes,17,opt,name=fee_recipient_address,json=feeRecipientAddress,proto3" json:"fee_recipient_address,omitempty"` - // Filters orders with the specified makerFeeAssetData - MakerFeeAssetData string `protobuf:"bytes,18,opt,name=maker_fee_asset_data,json=makerFeeAssetData,proto3" json:"maker_fee_asset_data,omitempty"` - // Filters orders with the specified takerFeeAssetData - TakerFeeAssetData string `protobuf:"bytes,19,opt,name=taker_fee_asset_data,json=takerFeeAssetData,proto3" json:"taker_fee_asset_data,omitempty"` - // Filters orders with the specified subaccount nonce - SubaccountNonce string `protobuf:"bytes,20,opt,name=subaccount_nonce,json=subaccountNonce,proto3" json:"subaccount_nonce,omitempty"` - // Filters orders to match a direction "long" or "short" - Direction string `protobuf:"bytes,21,opt,name=direction,proto3" json:"direction,omitempty"` - // Filter out orders whose price is not less than or equal to the filter bound - PriceLtOrEq string `protobuf:"bytes,22,opt,name=price_lt_or_eq,json=priceLtOrEq,proto3" json:"price_lt_or_eq,omitempty"` - // Filter out orders whose price is not greater than or equal to the filter - // bound - PriceGtOrEq string `protobuf:"bytes,23,opt,name=price_gt_or_eq,json=priceGtOrEq,proto3" json:"price_gt_or_eq,omitempty"` - // Filters orders to satisfy the indexPriceMinMarginRequirement - IndexPrice string `protobuf:"bytes,24,opt,name=index_price,json=indexPrice,proto3" json:"index_price,omitempty"` - // Filters orders to match the subaccountID - SubaccountID string `protobuf:"bytes,25,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` -} - -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_523db28b8af54781, []int{25} -} -func (m *OrderFilters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *QueryDerivativeMarketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OrderFilters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OrderFilters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (m *QueryDerivativeMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Markets) > 0 { + for iNdEx := len(m.Markets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Markets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return b[:n], nil } + return len(dAtA) - i, nil } -func (m *OrderFilters) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrderFilters.Merge(m, src) -} -func (m *OrderFilters) XXX_Size() int { - return m.Size() -} -func (m *OrderFilters) XXX_DiscardUnknown() { - xxx_messageInfo_OrderFilters.DiscardUnknown(m) -} - -var xxx_messageInfo_OrderFilters proto.InternalMessageInfo -func (m *OrderFilters) GetContractPriceBound() string { - if m != nil { - return m.ContractPriceBound +func (m *QueryDerivativeMarketRequest) 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 "" + return dAtA[:n], nil } -func (m *OrderFilters) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" +func (m *QueryDerivativeMarketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OrderFilters) GetIsLong() bool { - if m != nil { - return m.IsLong +func (m *QueryDerivativeMarketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0xa } - return false + return len(dAtA) - i, nil } -func (m *OrderFilters) GetNotExpired() bool { - if m != nil { - return m.NotExpired +func (m *QueryDerivativeMarketResponse) 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 false + return dAtA[:n], nil } -func (m *OrderFilters) GetMakerAssetAddress() string { - if m != nil { - return m.MakerAssetAddress - } - return "" +func (m *QueryDerivativeMarketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OrderFilters) GetTakerAssetAddress() string { - if m != nil { - return m.TakerAssetAddress +func (m *QueryDerivativeMarketResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return "" + return len(dAtA) - i, nil } -func (m *OrderFilters) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return "" + dAtA[offset] = uint8(v) + return base } - -func (m *OrderFilters) GetSenderAddress() string { - if m != nil { - return m.SenderAddress +func (m *QueryExchangeParamsRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *OrderFilters) GetMakerAssetData() string { - if m != nil { - return m.MakerAssetData - } - return "" -} - -func (m *OrderFilters) GetTakerAssetData() string { - if m != nil { - return m.TakerAssetData - } - return "" -} - -func (m *OrderFilters) GetMakerAssetAmount() string { - if m != nil { - return m.MakerAssetAmount - } - return "" -} - -func (m *OrderFilters) GetTakerAssetAmount() string { - if m != nil { - return m.TakerAssetAmount - } - return "" -} - -func (m *OrderFilters) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} - -func (m *OrderFilters) GetNotMakerAddress() string { - if m != nil { - return m.NotMakerAddress - } - return "" -} - -func (m *OrderFilters) GetTakerAddress() string { - if m != nil { - return m.TakerAddress - } - return "" -} - -func (m *OrderFilters) GetTraderAddress() string { - if m != nil { - return m.TraderAddress - } - return "" -} - -func (m *OrderFilters) GetFeeRecipientAddress() string { - if m != nil { - return m.FeeRecipientAddress - } - return "" + var l int + _ = l + return n } -func (m *OrderFilters) GetMakerFeeAssetData() string { - if m != nil { - return m.MakerFeeAssetData +func (m *QueryExchangeParamsResponse) Size() (n int) { + if m == nil { + return 0 } - return "" + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n } -func (m *OrderFilters) GetTakerFeeAssetData() string { - if m != nil { - return m.TakerFeeAssetData +func (m *QuerySubaccountDepositsRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *OrderFilters) GetSubaccountNonce() string { - if m != nil { - return m.SubaccountNonce + var l int + _ = l + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return "" + return n } -func (m *OrderFilters) GetDirection() string { - if m != nil { - return m.Direction +func (m *QuerySubaccountDepositsResponse) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *OrderFilters) GetPriceLtOrEq() string { - if m != nil { - return m.PriceLtOrEq + var l int + _ = l + if len(m.Deposits) > 0 { + for k, v := range m.Deposits { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } } - return "" + return n } -func (m *OrderFilters) GetPriceGtOrEq() string { - if m != nil { - return m.PriceGtOrEq +func (m *QuerySubaccountDepositRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *OrderFilters) GetIndexPrice() string { - if m != nil { - return m.IndexPrice + var l int + _ = l + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return "" -} - -func (m *OrderFilters) GetSubaccountID() string { - if m != nil { - return m.SubaccountID + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return "" -} - -// QueryDerivativeOrdersRequest defines the request type for -// Query/DerivativeOrdersRequest RPC method. -type QueryDerivativeOrdersRequest struct { - Filters *OrderFilters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` - // Filter by status of the order - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - // Filter by collection of the order - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - // Filter by trade pair hash - TradePairHash string `protobuf:"bytes,4,opt,name=trade_pair_hash,json=tradePairHash,proto3" json:"trade_pair_hash,omitempty"` + return n } -func (m *QueryDerivativeOrdersRequest) Reset() { *m = QueryDerivativeOrdersRequest{} } -func (m *QueryDerivativeOrdersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersRequest) ProtoMessage() {} -func (*QueryDerivativeOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{26} -} -func (m *QueryDerivativeOrdersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersRequest.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 *QuerySubaccountDepositResponse) Size() (n int) { + if m == nil { + return 0 } -} -func (m *QueryDerivativeOrdersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersRequest.Merge(m, src) -} -func (m *QueryDerivativeOrdersRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeOrdersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeOrdersRequest proto.InternalMessageInfo - -func (m *QueryDerivativeOrdersRequest) GetFilters() *OrderFilters { - if m != nil { - return m.Filters + var l int + _ = l + if m.Deposits != nil { + l = m.Deposits.Size() + n += 1 + l + sovQuery(uint64(l)) } - return nil + return n } -func (m *QueryDerivativeOrdersRequest) GetStatus() string { - if m != nil { - return m.Status +func (m *QuerySpotMarketsRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *QueryDerivativeOrdersRequest) GetCollection() string { - if m != nil { - return m.Collection + var l int + _ = l + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) } - return "" + return n } -func (m *QueryDerivativeOrdersRequest) GetTradePairHash() string { - if m != nil { - return m.TradePairHash +func (m *QuerySpotMarketsResponse) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -// QuerySubaccountDerivativeOrdersRequest defines the request type for -// Query/SubaccountDerivativeOrders RPC method. -type QuerySubaccountMarketDerivativeOrdersRequest struct { - MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - MakerAddress string `protobuf:"bytes,2,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - TakerFee string `protobuf:"bytes,3,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - SubaccountID string `protobuf:"bytes,4,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) Reset() { - *m = QuerySubaccountMarketDerivativeOrdersRequest{} -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) String() string { - return proto.CompactTextString(m) -} -func (*QuerySubaccountMarketDerivativeOrdersRequest) ProtoMessage() {} -func (*QuerySubaccountMarketDerivativeOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{27} -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + var l int + _ = l + if len(m.Markets) > 0 { + for _, e := range m.Markets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - return b[:n], nil - } -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersRequest.Merge(m, src) -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersRequest proto.InternalMessageInfo - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) GetTakerFee() string { - if m != nil { - return m.TakerFee } - return "" + return n } -func (m *QuerySubaccountMarketDerivativeOrdersRequest) GetSubaccountID() string { - if m != nil { - return m.SubaccountID +func (m *QuerySpotMarketRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -// QuerySubaccountDerivativeOrdersResponse defines the response type for -// Query/SubaccountDerivativeOrders RPC method. -type QuerySubaccountMarketDerivativeOrdersResponse struct { - Records []*Order `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -func (m *QuerySubaccountMarketDerivativeOrdersResponse) Reset() { - *m = QuerySubaccountMarketDerivativeOrdersResponse{} -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) String() string { - return proto.CompactTextString(m) -} -func (*QuerySubaccountMarketDerivativeOrdersResponse) ProtoMessage() {} -func (*QuerySubaccountMarketDerivativeOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{28} -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + var l int + _ = l + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersResponse.Merge(m, src) -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersResponse.DiscardUnknown(m) + return n } -var xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersResponse proto.InternalMessageInfo - -func (m *QuerySubaccountMarketDerivativeOrdersResponse) GetRecords() []*Order { - if m != nil { - return m.Records +func (m *QuerySpotMarketResponse) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -// QuerySubaccountDerivativeOrdersBatchRequest defines the request type for -// Query/SubaccountDerivativeOrdersBatch RPC method. -type QuerySubaccountMarketDerivativeOrdersBatchRequest struct { - MakerAddress string `protobuf:"bytes,1,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - TakerFee string `protobuf:"bytes,2,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - SubaccountID string `protobuf:"bytes,3,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` - MarketIds []string `protobuf:"bytes,5,rep,name=market_ids,json=marketIds,proto3" json:"market_ids,omitempty"` -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) Reset() { - *m = QuerySubaccountMarketDerivativeOrdersBatchRequest{} -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) String() string { - return proto.CompactTextString(m) -} -func (*QuerySubaccountMarketDerivativeOrdersBatchRequest) ProtoMessage() {} -func (*QuerySubaccountMarketDerivativeOrdersBatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{29} -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchRequest.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 *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchRequest.Merge(m, src) -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchRequest proto.InternalMessageInfo - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) GetMakerAddress() string { - if m != nil { - return m.MakerAddress - } - return "" -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) GetTakerFee() string { - if m != nil { - return m.TakerFee - } - return "" -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) GetSubaccountID() string { - if m != nil { - return m.SubaccountID - } - return "" -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) GetMarketIds() []string { - if m != nil { - return m.MarketIds - } - return nil -} - -// QuerySubaccountDerivativeOrdersBatchResponse defines the response type for -// Query/SubaccountDerivativeOrdersBatch RPC method. -type QuerySubaccountMarketDerivativeOrdersBatchResponse struct { - MarketRecords map[string]*QuerySubaccountMarketDerivativeOrdersResponse `protobuf:"bytes,1,rep,name=market_records,json=marketRecords,proto3" json:"market_records,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Reset() { - *m = QuerySubaccountMarketDerivativeOrdersBatchResponse{} -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) String() string { - return proto.CompactTextString(m) -} -func (*QuerySubaccountMarketDerivativeOrdersBatchResponse) ProtoMessage() {} -func (*QuerySubaccountMarketDerivativeOrdersBatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{30} -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchResponse.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 *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchResponse.Merge(m, src) -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubaccountMarketDerivativeOrdersBatchResponse proto.InternalMessageInfo - -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) GetMarketRecords() map[string]*QuerySubaccountMarketDerivativeOrdersResponse { - if m != nil { - return m.MarketRecords - } - return nil -} - -// QuerySpotOrdersRequest defines the request type for -// Query/SpotOrders RPC method. -type QuerySpotOrdersRequest struct { - Filters *OrderFilters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` - // Filter by status of the order - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - // Filter by collection of the order - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - // Filter by trade pair hash - TradePairHash string `protobuf:"bytes,4,opt,name=trade_pair_hash,json=tradePairHash,proto3" json:"trade_pair_hash,omitempty"` -} - -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_523db28b8af54781, []int{31} -} -func (m *QuerySpotOrdersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotOrdersRequest.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 *QuerySpotOrdersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotOrdersRequest.Merge(m, src) -} -func (m *QuerySpotOrdersRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotOrdersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotOrdersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotOrdersRequest proto.InternalMessageInfo - -func (m *QuerySpotOrdersRequest) GetFilters() *OrderFilters { - if m != nil { - return m.Filters - } - return nil -} - -func (m *QuerySpotOrdersRequest) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *QuerySpotOrdersRequest) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *QuerySpotOrdersRequest) GetTradePairHash() string { - if m != nil { - return m.TradePairHash - } - return "" -} - -// QuerySpotOrdersResponse defines the request type for -// Query/SpotOrders RPC method. -type QuerySpotOrdersResponse struct { - // An array of matched orders. - Records []*Order `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -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_523db28b8af54781, []int{32} -} -func (m *QuerySpotOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotOrdersResponse.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 *QuerySpotOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotOrdersResponse.Merge(m, src) -} -func (m *QuerySpotOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotOrdersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotOrdersResponse proto.InternalMessageInfo - -func (m *QuerySpotOrdersResponse) GetRecords() []*Order { - if m != nil { - return m.Records - } - return nil -} - -// 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 *QuerySpotMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotMarketRequest.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 *QuerySpotMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotMarketRequest.Merge(m, src) -} -func (m *QuerySpotMarketRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotMarketRequest proto.InternalMessageInfo - -func (m *QuerySpotMarketRequest) GetTicker() string { - if m != nil { - return m.Ticker - } - return "" -} - -func (m *QuerySpotMarketRequest) GetExchangeAddress() string { - if m != nil { - return m.ExchangeAddress - } - return "" -} - -func (m *QuerySpotMarketRequest) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" -} - -func (m *QuerySpotMarketRequest) GetBaseAsset() string { - if m != nil { - return m.BaseAsset - } - return "" -} - -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 *QuerySpotMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotMarketResponse.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 *QuerySpotMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotMarketResponse.Merge(m, src) -} -func (m *QuerySpotMarketResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotMarketResponse proto.InternalMessageInfo - -func (m *QuerySpotMarketResponse) GetMarket() *SpotMarket { - if m != nil { - return m.Market - } - return nil -} - -// QueryDerivativeMarketRequest defines the request type for -// Query/DerivativeMarket RPC method. -type QueryDerivativeMarketRequest struct { - MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` -} - -func (m *QueryDerivativeMarketRequest) Reset() { *m = QueryDerivativeMarketRequest{} } -func (m *QueryDerivativeMarketRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeMarketRequest) ProtoMessage() {} -func (*QueryDerivativeMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{35} -} -func (m *QueryDerivativeMarketRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeMarketRequest.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 *QueryDerivativeMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeMarketRequest.Merge(m, src) -} -func (m *QueryDerivativeMarketRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeMarketRequest proto.InternalMessageInfo - -func (m *QueryDerivativeMarketRequest) GetMarketId() string { - if m != nil { - return m.MarketId - } - return "" -} - -func (m *QueryDerivativeMarketRequest) GetTicker() string { - if m != nil { - return m.Ticker - } - return "" -} - -// QueryDerivativeMarketResponse defines the request type for -// Query/DerivativeMarket RPC method. -type QueryDerivativeMarketResponse struct { - Market *DerivativeMarket `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` -} - -func (m *QueryDerivativeMarketResponse) Reset() { *m = QueryDerivativeMarketResponse{} } -func (m *QueryDerivativeMarketResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeMarketResponse) ProtoMessage() {} -func (*QueryDerivativeMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{36} -} -func (m *QueryDerivativeMarketResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeMarketResponse.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 *QueryDerivativeMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeMarketResponse.Merge(m, src) -} -func (m *QueryDerivativeMarketResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeMarketResponse proto.InternalMessageInfo - -func (m *QueryDerivativeMarketResponse) GetMarket() *DerivativeMarket { - if m != nil { - return m.Market - } - return nil -} - -// QuerySpotMarketsRequest defines the request type for -// Query/SpotMarkets RPC method. -type QuerySpotMarketsRequest struct { -} - -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 *QuerySpotMarketsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotMarketsRequest.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 *QuerySpotMarketsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotMarketsRequest.Merge(m, src) -} -func (m *QuerySpotMarketsRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotMarketsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotMarketsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotMarketsRequest proto.InternalMessageInfo - -// QuerySpotMarketsResponse defines the response type for -// Query/SpotMarkets RPC method. -type QuerySpotMarketsResponse struct { - // Array of found trade pairs - Records []*SpotMarket `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -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 *QuerySpotMarketsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotMarketsResponse.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 *QuerySpotMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotMarketsResponse.Merge(m, src) -} -func (m *QuerySpotMarketsResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotMarketsResponse proto.InternalMessageInfo - -func (m *QuerySpotMarketsResponse) GetRecords() []*SpotMarket { - if m != nil { - return m.Records - } - return nil -} - -// QueryDerivativeOrdersResponse defines the response type for -// Query/DerivativeOrders RPC method. -type QueryDerivativeOrdersResponse struct { - // An array of matched orders. - Records []*Order `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -func (m *QueryDerivativeOrdersResponse) Reset() { *m = QueryDerivativeOrdersResponse{} } -func (m *QueryDerivativeOrdersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDerivativeOrdersResponse) ProtoMessage() {} -func (*QueryDerivativeOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_523db28b8af54781, []int{39} -} -func (m *QueryDerivativeOrdersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDerivativeOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDerivativeOrdersResponse.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 *QueryDerivativeOrdersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDerivativeOrdersResponse.Merge(m, src) -} -func (m *QueryDerivativeOrdersResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDerivativeOrdersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDerivativeOrdersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDerivativeOrdersResponse proto.InternalMessageInfo - -func (m *QueryDerivativeOrdersResponse) GetRecords() []*Order { - if m != nil { - return m.Records - } - return nil -} - -func init() { - 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/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, 0xe7, 0x95, 0x9a, 0x6a, 0x54, 0x71, 0xf1, 0x78, 0xa5, 0x8c, - 0x89, 0xba, 0x52, 0x3c, 0x6a, 0x61, 0xeb, 0xa4, 0xd0, 0xb4, 0x4c, 0x62, 0xa2, 0xbc, 0xab, 0x57, - 0x10, 0x7a, 0x05, 0xae, 0x97, 0xbf, 0x52, 0x35, 0xcd, 0x6a, 0x1d, 0x17, 0xd5, 0xa6, 0x5e, 0x54, - 0x0d, 0xc3, 0x24, 0x2a, 0xd1, 0x4d, 0xc3, 0x66, 0x96, 0xf9, 0x9b, 0x31, 0x33, 0xb8, 0x43, 0x31, - 0xd5, 0x1b, 0x31, 0xaa, 0x4d, 0xd5, 0x52, 0x1b, 0x62, 0xcc, 0x99, 0xaa, 0x59, 0x35, 0xe9, 0xcf, - 0xa2, 0xf3, 0x8b, 0x49, 0xe5, 0x2b, 0x90, 0x7f, 0xe2, 0x40, 0x7e, 0xc8, 0x6d, 0xf7, 0xa9, 0x49, - 0x09, 0x1f, 0xb5, 0xb0, 0x4d, 0x64, 0x05, 0x2e, 0x47, 0xbe, 0xb5, 0x9b, 0xa6, 0x61, 0x63, 0xf4, - 0x55, 0x18, 0x64, 0x53, 0xe4, 0xa4, 0x6b, 0xd2, 0xe2, 0xe8, 0xaa, 0x5c, 0xe8, 0xec, 0x71, 0x81, - 0xd9, 0x6e, 0xf6, 0x7f, 0xf9, 0x8f, 0xb9, 0x73, 0x25, 0x6e, 0x27, 0xff, 0x47, 0x82, 0x37, 0xe8, - 0x0c, 0x5b, 0xd8, 0xd2, 0x8f, 0x55, 0xc7, 0xf2, 0x43, 0x4b, 0xc3, 0x96, 0xfd, 0xa4, 0x65, 0x12, - 0xcc, 0x61, 0xa0, 0x9b, 0x30, 0x29, 0x86, 0x53, 0x54, 0x4d, 0xb3, 0xb0, 0xcd, 0x66, 0x1c, 0x29, - 0x4d, 0x08, 0xf9, 0x06, 0x13, 0xa3, 0xcb, 0x30, 0xd2, 0x50, 0xad, 0x43, 0x4c, 0x14, 0x5d, 0xcb, - 0x65, 0xa8, 0xce, 0x30, 0x13, 0xec, 0x68, 0x28, 0x0f, 0xc3, 0x47, 0x2d, 0xd5, 0x20, 0x3a, 0x39, - 0xc9, 0xf5, 0xb1, 0x77, 0xe2, 0x19, 0x5d, 0x80, 0x41, 0xdd, 0xde, 0x35, 0x8d, 0x6a, 0xae, 0xff, - 0x9a, 0xb4, 0x38, 0x5c, 0xe2, 0x4f, 0x68, 0x1e, 0xb2, 0x0d, 0xf5, 0x10, 0x5b, 0xee, 0xc4, 0x03, - 0xd4, 0x70, 0x8c, 0x0a, 0xc5, 0xac, 0xcb, 0x80, 0x0e, 0xf4, 0x3a, 0xc1, 0x96, 0xd2, 0xb4, 0xf4, - 0x0a, 0x56, 0xca, 0x66, 0xcb, 0xd0, 0x72, 0x83, 0x54, 0x73, 0x92, 0xbd, 0xd9, 0x77, 0x5e, 0x6c, - 0x3a, 0x72, 0x59, 0x03, 0x39, 0xce, 0x67, 0x4e, 0xee, 0x3a, 0x0c, 0x1e, 0x39, 0x02, 0xc7, 0xd5, - 0xbe, 0xc5, 0xd1, 0xd5, 0x85, 0x38, 0x72, 0xe9, 0x00, 0xcc, 0x9e, 0x5b, 0xc9, 0x3f, 0x94, 0x60, - 0xa1, 0xf3, 0x34, 0x9b, 0x2a, 0xa9, 0xd4, 0x04, 0xbf, 0x1a, 0x8c, 0x53, 0x23, 0xc5, 0x62, 0x02, - 0x31, 0xe5, 0xfb, 0x71, 0x53, 0x76, 0x0d, 0x5b, 0x29, 0x7b, 0xe4, 0x7b, 0xb2, 0xe5, 0xe7, 0x70, - 0xa3, 0x2b, 0x1e, 0xee, 0xfb, 0x1e, 0x8c, 0x99, 0xce, 0x3b, 0x25, 0xc0, 0xc0, 0x52, 0x32, 0x06, - 0x76, 0x8c, 0x03, 0xb3, 0x34, 0x6a, 0xba, 0xcf, 0xb6, 0xfc, 0x73, 0x09, 0xee, 0x46, 0x4d, 0x5d, - 0x36, 0xcd, 0xc3, 0x2d, 0xdc, 0x24, 0x35, 0x3a, 0xfb, 0xc6, 0x71, 0xf5, 0x9b, 0x58, 0xaf, 0xd6, - 0x08, 0xd6, 0x68, 0xb0, 0x5e, 0x2f, 0x3b, 0xcf, 0xe0, 0x5e, 0x2f, 0x10, 0x39, 0x61, 0xcb, 0x80, - 0xd4, 0xe3, 0xaa, 0xf2, 0x1d, 0xfe, 0x92, 0x2d, 0x43, 0x8a, 0x73, 0xa4, 0x34, 0xa9, 0xb6, 0x59, - 0xc9, 0x3f, 0x95, 0xe0, 0x4e, 0xec, 0x64, 0x9d, 0xa8, 0x28, 0x43, 0x36, 0x40, 0x05, 0xcf, 0xfb, - 0x53, 0x32, 0x31, 0xe6, 0x67, 0x42, 0xc6, 0xf0, 0x76, 0x4a, 0x6c, 0x5d, 0x38, 0x90, 0x22, 0x39, - 0xf8, 0x8d, 0x04, 0xd7, 0xe8, 0x3c, 0x4f, 0x5b, 0x65, 0xb5, 0x52, 0x31, 0x5b, 0x06, 0xd9, 0x53, - 0xad, 0xaa, 0x6e, 0x3c, 0x32, 0xeb, 0x9a, 0xf0, 0x37, 0x94, 0xfc, 0x52, 0x44, 0xf2, 0x5f, 0x86, - 0x11, 0x42, 0x95, 0x0e, 0x30, 0x16, 0x5b, 0x0e, 0x15, 0x6c, 0x63, 0xec, 0x8c, 0x50, 0x56, 0x6d, - 0xac, 0x54, 0x5a, 0x96, 0x85, 0x8d, 0x8a, 0xd8, 0x77, 0xc6, 0x1c, 0xe1, 0x03, 0x2e, 0x43, 0x6f, - 0xc2, 0xb8, 0xed, 0xa2, 0x50, 0x74, 0x45, 0xa3, 0x7b, 0xd0, 0x48, 0x69, 0xcc, 0x93, 0xee, 0x6c, - 0xc9, 0x5b, 0x7c, 0xab, 0x8c, 0x06, 0xcc, 0x49, 0x98, 0x83, 0xd1, 0x06, 0x95, 0x2a, 0x35, 0xb3, - 0xae, 0x71, 0xbc, 0xd0, 0x70, 0x15, 0xe5, 0x75, 0x98, 0xeb, 0x44, 0xaf, 0xf0, 0x3a, 0xb0, 0x87, - 0x4a, 0xc1, 0x3d, 0x54, 0xfe, 0x99, 0xe0, 0x2d, 0x72, 0x00, 0x6f, 0xef, 0xb2, 0x6b, 0xa6, 0x45, - 0x12, 0xed, 0x5d, 0x34, 0x1e, 0xbb, 0xf8, 0x18, 0xd7, 0x4b, 0xdc, 0x0a, 0xdd, 0x87, 0x81, 0xba, - 0x69, 0x54, 0xed, 0x5c, 0x26, 0x95, 0x39, 0x33, 0x92, 0x5f, 0x48, 0x70, 0x81, 0x42, 0x64, 0xfc, - 0xd0, 0xfd, 0xe0, 0xcc, 0x02, 0x1a, 0x8e, 0x55, 0x5f, 0x38, 0x56, 0xe1, 0xb0, 0xf7, 0x47, 0x84, - 0x3d, 0xea, 0x58, 0x1b, 0x88, 0x3c, 0xd6, 0xe4, 0x32, 0x5c, 0x0c, 0x79, 0xc4, 0xb9, 0xfe, 0xc0, - 0x8d, 0xb8, 0x6e, 0x1c, 0x98, 0x3c, 0x23, 0x63, 0x19, 0xf3, 0x0d, 0xc2, 0x57, 0x86, 0xf3, 0x5b, - 0xfe, 0xa3, 0x04, 0x39, 0x3a, 0xc9, 0xbe, 0x69, 0xeb, 0x4e, 0x35, 0xf2, 0xbf, 0x20, 0x2e, 0xb0, - 0xf6, 0xfa, 0xdb, 0xce, 0xef, 0x14, 0x84, 0x3d, 0x83, 0x4b, 0x11, 0xbe, 0xb8, 0xc7, 0x4b, 0xb6, - 0xc9, 0xe5, 0x7e, 0xd2, 0x16, 0x63, 0x97, 0x99, 0x7f, 0xa0, 0xb1, 0xa6, 0xef, 0x49, 0xb6, 0x79, - 0x62, 0x7e, 0xc3, 0x52, 0x35, 0x6c, 0x79, 0xe9, 0x69, 0xa7, 0x26, 0x30, 0xca, 0xc1, 0x4c, 0xb4, - 0x83, 0x27, 0xbc, 0x88, 0xe8, 0x30, 0x29, 0xf7, 0xf4, 0x29, 0x4c, 0xf8, 0x49, 0x67, 0xbe, 0x76, - 0x3d, 0x4b, 0xbd, 0xd1, 0xe8, 0x60, 0xbe, 0xb8, 0x51, 0x7f, 0xbf, 0x06, 0x57, 0xdb, 0x76, 0x80, - 0x3d, 0x1a, 0x21, 0x3b, 0x7d, 0xbd, 0x26, 0xd7, 0x60, 0xb6, 0xd3, 0x58, 0xdc, 0x85, 0x6d, 0x18, - 0x62, 0x0b, 0x40, 0x6c, 0x26, 0xcb, 0x71, 0xd0, 0xdb, 0xc7, 0x29, 0x09, 0x63, 0x37, 0x4a, 0x1f, - 0x19, 0x1a, 0xb6, 0x58, 0x0a, 0x60, 0x6d, 0x83, 0x93, 0xe6, 0x8b, 0x52, 0x30, 0x6f, 0xa5, 0x84, - 0x79, 0xdb, 0x21, 0x4a, 0x16, 0x8f, 0x52, 0x87, 0x49, 0xb9, 0x8b, 0xbb, 0x30, 0x2c, 0xa2, 0xc7, - 0x7d, 0xbc, 0x15, 0xe7, 0x63, 0xd4, 0x60, 0x25, 0x77, 0x04, 0xf9, 0x97, 0x7d, 0x30, 0x13, 0xa5, - 0xc2, 0xcf, 0x06, 0x27, 0xb7, 0x0c, 0xb5, 0x81, 0x7d, 0x67, 0xc3, 0x21, 0x26, 0x8f, 0xd5, 0x06, - 0x46, 0xd7, 0x61, 0xbc, 0xa1, 0xdb, 0xb6, 0x6e, 0x54, 0x15, 0xb5, 0xe1, 0x98, 0x70, 0xb7, 0xb2, - 0x5c, 0xba, 0xd1, 0xf0, 0x8d, 0xe3, 0x9e, 0x31, 0x7d, 0xed, 0x67, 0x8c, 0x33, 0x0e, 0x31, 0x89, - 0x5a, 0x57, 0x34, 0x4c, 0x13, 0xc5, 0xe6, 0x99, 0x9c, 0xa5, 0xd2, 0x2d, 0x2e, 0x0c, 0xe6, 0xfa, - 0x40, 0x82, 0x5c, 0x1f, 0x8c, 0xae, 0xf9, 0xe7, 0x21, 0xeb, 0x5f, 0xe4, 0x5a, 0x6e, 0x28, 0xb4, - 0xb1, 0x68, 0xe1, 0xfc, 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, 0x28, 0xc0, 0x02, - 0x4b, 0x89, 0x51, 0x56, 0x50, 0xfa, 0x48, 0x60, 0x59, 0xb1, 0x0c, 0x88, 0x84, 0xb5, 0x59, 0xd4, - 0x27, 0x49, 0xbb, 0x76, 0x68, 0x39, 0x66, 0x23, 0x96, 0xe3, 0x12, 0x4c, 0x39, 0x71, 0x0a, 0x2a, - 0x8e, 0x33, 0x9e, 0x0c, 0x93, 0xec, 0xf9, 0x75, 0xe7, 0x21, 0x4b, 0x02, 0x7a, 0x13, 0x6c, 0x40, - 0xe2, 0x57, 0x72, 0x12, 0x93, 0x9e, 0x17, 0xae, 0xd6, 0x24, 0x4f, 0x4c, 0x2a, 0x15, 0x6a, 0xab, - 0x70, 0xfe, 0x00, 0x3b, 0x45, 0x7e, 0x45, 0x6f, 0xea, 0xd8, 0xf0, 0x02, 0x3a, 0x45, 0xb5, 0xa7, - 0x0f, 0x30, 0x2e, 0x89, 0x77, 0xc2, 0xa6, 0x08, 0x33, 0x0d, 0x71, 0xf6, 0xfb, 0xa9, 0x45, 0xbe, - 0x35, 0xb3, 0x8d, 0xb1, 0xc7, 0x6e, 0x11, 0x66, 0x48, 0x94, 0xc1, 0xb4, 0x6f, 0xd1, 0x04, 0x0c, - 0x6e, 0xc2, 0xa4, 0x2f, 0xcd, 0x59, 0x9e, 0xce, 0x30, 0x32, 0x3c, 0xf9, 0x63, 0x9a, 0xb1, 0x57, - 0x60, 0x44, 0xd3, 0x2d, 0x67, 0xff, 0x34, 0x8d, 0xdc, 0x79, 0x96, 0xb0, 0xae, 0x00, 0xcd, 0xc3, - 0x38, 0xcb, 0xae, 0x3a, 0x51, 0x4c, 0x4b, 0xc1, 0x47, 0xb9, 0x0b, 0x54, 0x65, 0x94, 0x4a, 0x77, - 0xc9, 0x87, 0xd6, 0xc3, 0x23, 0x4f, 0xa9, 0x2a, 0x94, 0x2e, 0xfa, 0x94, 0x3e, 0x60, 0x4a, 0x73, - 0x30, 0xaa, 0x1b, 0x1a, 0x7e, 0xce, 0x53, 0x3c, 0xc7, 0x52, 0x9c, 0x8a, 0x68, 0x92, 0x46, 0x14, - 0x3d, 0x97, 0x22, 0x2a, 0xfb, 0x2f, 0x24, 0xb8, 0x12, 0x79, 0x4d, 0x12, 0xc7, 0xd2, 0x26, 0x0c, - 0xb1, 0xaf, 0x08, 0x76, 0x92, 0x52, 0xc5, 0xbf, 0xa7, 0x94, 0x84, 0xa1, 0xb3, 0x4d, 0xd9, 0x44, - 0x25, 0x2d, 0x71, 0x56, 0xf1, 0x27, 0x34, 0x0b, 0x50, 0x31, 0xeb, 0x75, 0x4e, 0x16, 0xdf, 0xcc, - 0x3d, 0x09, 0x5a, 0x80, 0x09, 0xba, 0x3a, 0x94, 0xa6, 0xaa, 0xf3, 0x2d, 0xb0, 0xdf, 0xb7, 0x68, - 0xf6, 0x55, 0x9d, 0x6e, 0x83, 0xf2, 0xef, 0x24, 0x58, 0x0e, 0xdf, 0x4f, 0x0e, 0x31, 0xe9, 0xe4, - 0x54, 0xdc, 0x35, 0x23, 0x9c, 0x1f, 0x99, 0x6e, 0xf5, 0x66, 0x5f, 0xd7, 0x7a, 0x33, 0xea, 0x52, - 0x55, 0x87, 0xb7, 0x12, 0x82, 0xe6, 0x67, 0xf5, 0x7b, 0x30, 0x64, 0xe1, 0x8a, 0x69, 0x69, 0xe2, - 0xa8, 0x7e, 0xa3, 0x6b, 0x28, 0x4a, 0xc2, 0x42, 0xfe, 0x5c, 0x82, 0x95, 0x44, 0xd3, 0x05, 0x3e, - 0xcf, 0xbc, 0xae, 0xda, 0xfb, 0x2a, 0x80, 0x1b, 0x10, 0x67, 0xb3, 0xef, 0x73, 0xd2, 0x46, 0x44, - 0xc4, 0x96, 0xff, 0x94, 0x81, 0xd5, 0x34, 0xe0, 0x39, 0x61, 0xdf, 0x93, 0x60, 0x9c, 0x0f, 0x1b, - 0x24, 0x4e, 0xed, 0xfa, 0xd5, 0x20, 0xd5, 0x44, 0x05, 0x5e, 0xf0, 0xb1, 0x39, 0x1e, 0x1a, 0xc4, - 0x3a, 0x29, 0x65, 0x1b, 0x7e, 0x59, 0xfe, 0x07, 0x12, 0xa0, 0xb0, 0x16, 0x9a, 0x84, 0xbe, 0x43, - 0x2c, 0x4a, 0x3d, 0xe7, 0x27, 0x52, 0x60, 0xe0, 0x58, 0xad, 0xb7, 0x18, 0x91, 0xa3, 0xab, 0x3b, - 0xa7, 0x46, 0x2a, 0x40, 0x96, 0xd8, 0xb8, 0xf7, 0x32, 0x6b, 0x92, 0xfc, 0x07, 0x71, 0x4d, 0x7d, - 0xda, 0x34, 0xc9, 0xff, 0x5f, 0xbe, 0x7f, 0xcc, 0xaf, 0xa4, 0x7e, 0xf4, 0x67, 0x91, 0x23, 0x9f, - 0xf9, 0x69, 0x11, 0xd1, 0x62, 0xb4, 0x5c, 0x80, 0x41, 0xa2, 0x57, 0x0e, 0xb1, 0xc5, 0x63, 0xc5, - 0x9f, 0x52, 0x14, 0xe4, 0xc1, 0x4d, 0xa7, 0xaf, 0x6d, 0xd3, 0xb9, 0x0a, 0x40, 0xab, 0x7f, 0x7a, - 0x1a, 0x71, 0xaf, 0x47, 0x1c, 0x09, 0x3d, 0x84, 0x9c, 0xdd, 0x9e, 0x7d, 0xfd, 0x62, 0xef, 0x59, - 0x35, 0x04, 0x54, 0x44, 0x15, 0xe4, 0x6f, 0xf9, 0x28, 0x11, 0xc8, 0xbd, 0x2f, 0x22, 0x6c, 0x9a, - 0x24, 0x17, 0x74, 0x9f, 0x3d, 0xb7, 0x92, 0x9f, 0x86, 0x4e, 0x88, 0x20, 0x35, 0xb1, 0x9b, 0xa9, - 0xc7, 0x5b, 0xc6, 0xcf, 0x9b, 0x8c, 0x3b, 0x5c, 0xe4, 0x5c, 0xd4, 0x5b, 0x6d, 0xa8, 0xd3, 0x5d, - 0xbd, 0x04, 0xf6, 0x4b, 0x21, 0x5a, 0xdc, 0x06, 0xc3, 0x27, 0xfc, 0x93, 0x43, 0xe0, 0x95, 0xdb, - 0x5d, 0x68, 0x5b, 0x45, 0x49, 0x39, 0x73, 0x97, 0xd2, 0x27, 0x21, 0xff, 0xce, 0x70, 0xa1, 0xae, - 0x7e, 0xff, 0x1a, 0x0c, 0xd0, 0xe1, 0xd1, 0xaf, 0x24, 0x98, 0x68, 0xcb, 0x05, 0xb4, 0xda, 0x7d, - 0xcf, 0x68, 0x4f, 0xfb, 0xfc, 0xed, 0x54, 0x36, 0xcc, 0x07, 0xb9, 0xf0, 0xe9, 0x5f, 0xff, 0xf5, - 0xe3, 0xcc, 0x22, 0x5a, 0x28, 0xc6, 0x74, 0x82, 0x6c, 0x0f, 0x58, 0x00, 0x2c, 0x63, 0x2c, 0x21, - 0xd8, 0xc0, 0x8a, 0x4b, 0x08, 0x36, 0xb8, 0xa0, 0x92, 0x83, 0xe5, 0xc0, 0x7e, 0x2d, 0xc1, 0x64, - 0xfb, 0x02, 0x41, 0x69, 0x66, 0x76, 0xb9, 0xbd, 0x93, 0xce, 0x88, 0xe3, 0x2d, 0x52, 0xbc, 0x37, - 0xd1, 0x8d, 0x64, 0x78, 0x6d, 0xf4, 0x99, 0x04, 0xe7, 0x23, 0x73, 0x0a, 0xad, 0xa5, 0xf8, 0x48, - 0x1e, 0x64, 0xfa, 0x6e, 0x0f, 0x96, 0x1c, 0xff, 0x12, 0xc5, 0xff, 0x26, 0x92, 0xe3, 0xf0, 0xb3, - 0x34, 0x45, 0xee, 0x79, 0x14, 0xfa, 0x16, 0x83, 0xd2, 0x23, 0x70, 0x79, 0xbf, 0xd7, 0x8b, 0x29, - 0x47, 0xff, 0x15, 0x8a, 0xfe, 0x3a, 0x9a, 0xef, 0x8e, 0xde, 0x46, 0x5f, 0x84, 0x99, 0xe7, 0x2b, - 0x7e, 0x2d, 0x75, 0x7b, 0xa2, 0x17, 0xe6, 0xdb, 0xd2, 0xf2, 0x0e, 0xc5, 0x5e, 0x40, 0xcb, 0x71, - 0xd8, 0xb5, 0x76, 0xa8, 0x9f, 0x66, 0xe0, 0x7a, 0xa2, 0x82, 0x02, 0x3d, 0x3a, 0x83, 0x9a, 0x84, - 0x39, 0x79, 0x76, 0xd5, 0x8d, 0xbc, 0x45, 0x9d, 0x5e, 0x47, 0xf7, 0x63, 0xd3, 0xa5, 0x9b, 0x6b, - 0x3f, 0xc9, 0xc0, 0x52, 0xf2, 0xfa, 0x0f, 0xed, 0x9d, 0x55, 0x1d, 0xc9, 0xe8, 0x78, 0x7c, 0xb6, - 0x65, 0xa9, 0xbc, 0x43, 0x39, 0x79, 0x80, 0x36, 0x4e, 0xc3, 0x09, 0xf3, 0xf4, 0x6f, 0x12, 0xef, - 0xd6, 0x47, 0xb6, 0xd3, 0xd0, 0xe9, 0xda, 0x70, 0xf9, 0xf5, 0x5e, 0xcd, 0xb9, 0xa3, 0x77, 0xa9, - 0xa3, 0xb7, 0xd1, 0x4a, 0x9a, 0x15, 0xcf, 0x90, 0xff, 0x5b, 0x8a, 0xee, 0x4a, 0x31, 0xbf, 0x99, - 0xce, 0x66, 0x6f, 0xf0, 0x02, 0xb1, 0x7d, 0x70, 0xaa, 0x31, 0xb8, 0x9f, 0xeb, 0xd4, 0xcf, 0x35, - 0xf4, 0x4e, 0x1a, 0x3f, 0x7d, 0x8e, 0xfc, 0x5e, 0xdc, 0xa3, 0x52, 0xb5, 0x7a, 0xd1, 0x47, 0x69, - 0xb1, 0x27, 0xea, 0x6e, 0xe7, 0x3f, 0x3e, 0xeb, 0x61, 0x39, 0x4b, 0x4f, 0x28, 0x4b, 0x5f, 0x47, - 0x3b, 0x29, 0x58, 0xea, 0xc2, 0xc0, 0x2f, 0x32, 0xfc, 0xb2, 0x9e, 0xb4, 0x35, 0x8c, 0xf6, 0x7b, - 0x76, 0xae, 0x13, 0x5d, 0x4f, 0xce, 0x70, 0x44, 0xce, 0xd4, 0x2e, 0x65, 0x6a, 0x1b, 0x6d, 0xf5, - 0xc2, 0x54, 0xc8, 0xe5, 0xbf, 0x48, 0xbc, 0xf3, 0x15, 0xd5, 0x26, 0x46, 0xf7, 0xd3, 0x6d, 0x6e, - 0xc1, 0x76, 0x78, 0xfe, 0xfd, 0x1e, 0xad, 0xb9, 0xa3, 0x6b, 0xd4, 0xd1, 0x55, 0x74, 0x2b, 0xf1, - 0x4e, 0x28, 0x60, 0xff, 0x59, 0xb4, 0x26, 0x23, 0xc8, 0x45, 0xef, 0xf5, 0x12, 0x12, 0xe1, 0xd2, - 0xfd, 0xde, 0x8c, 0xb9, 0x47, 0xef, 0x52, 0x8f, 0x56, 0x50, 0x31, 0x65, 0xe8, 0xbc, 0x22, 0xdc, - 0xeb, 0xc5, 0x26, 0x28, 0xc2, 0x43, 0xfd, 0xec, 0x04, 0x45, 0x78, 0xb8, 0x63, 0x9c, 0xac, 0x08, - 0xf7, 0x1a, 0xc3, 0xe8, 0xb7, 0x12, 0x4c, 0x85, 0x9a, 0xa9, 0xa8, 0x7b, 0x41, 0x1d, 0xd1, 0x47, - 0xce, 0xbf, 0x9d, 0xd2, 0x8a, 0x43, 0xbe, 0x45, 0x21, 0x2f, 0xa1, 0xc5, 0x38, 0xc8, 0xfe, 0xa6, - 0xac, 0x77, 0x56, 0x46, 0x36, 0x48, 0x13, 0x9c, 0x95, 0x71, 0xdd, 0xdc, 0x04, 0x67, 0x65, 0x6c, - 0x5f, 0x36, 0xd9, 0x59, 0x49, 0x22, 0x91, 0xbb, 0x8e, 0x45, 0xf6, 0x14, 0x13, 0x38, 0x16, 0xd7, - 0x00, 0x4d, 0xe0, 0x58, 0x6c, 0x2b, 0x33, 0x99, 0x63, 0xad, 0x48, 0xe4, 0x9f, 0x4b, 0x30, 0x1d, - 0xf1, 0x6f, 0x43, 0xf4, 0x4e, 0x57, 0x48, 0x91, 0x7f, 0x5e, 0xcc, 0xbf, 0x9b, 0xda, 0x8e, 0xfb, - 0xb0, 0x4a, 0x7d, 0x58, 0x46, 0x4b, 0xc5, 0x04, 0x7f, 0xc3, 0xe4, 0x7f, 0x6b, 0xac, 0x7d, 0xf9, - 0x72, 0x56, 0x7a, 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. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -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. - QuerySpotMarket(ctx context.Context, in *QuerySpotMarketRequest, opts ...grpc.CallOption) (*QuerySpotMarketResponse, error) - // Retrieves a list of trade pairs. - 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. - QueryDerivativeMarkets(ctx context.Context, in *QueryDerivativeMarketsRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketsResponse, error) - // Retrieves a list of derivative orders matching the filtering rules. - QueryDerivativeOrders(ctx context.Context, in *QueryDerivativeOrdersRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersResponse, error) - // Retrieves a list of derivative orders for a provided subaccount and - // marketID. - QuerySubaccountMarketDerivativeOrders(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersResponse, error) - // Retrieves a list of derivative orders for a provided subaccount and - // marketID for a batch of markets - QuerySubaccountMarketDerivativeOrdersBatch(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersBatchRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersBatchResponse, error) - // Retrieves a list of orders matching a given market, direction and quantity - QueryDerivativeOrdersQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteResponse, error) - // Retrieves a batch list of orders matching a given market, direction and quantity - QueryDerivativeOrdersBatchQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteBatchRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteBatchResponse, error) - // Retrieves a batch list of average weighted prices for a given derivative market, direction and quantity - QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse, error) - // Retrieves a batch list of average weighted prices for a given derivative market, direction and quantity - QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse, error) - // Retrieves a list of orders matching a given market, direction and quantity - QuerySubaccountMarginHold(ctx context.Context, in *QuerySubaccountMarginHoldRequest, opts ...grpc.CallOption) (*QuerySubaccountMarginHoldResponse, error) - // Retrieves a derivative market orderbook - QueryDerivativeOrderbook(ctx context.Context, in *QueryDerivativeOrderbookRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookResponse, error) - // Retrieves a subaccount's margin info for a given base currency - QueryMarginInfo(ctx context.Context, in *QueryMarginInfoRequest, opts ...grpc.CallOption) (*QueryMarginInfoResponse, error) - // Retrieves a subaccount's margin info for a given base currency - QueryPositionInfo(ctx context.Context, in *QueryPositionInfoRequest, opts ...grpc.CallOption) (*QueryPositionInfoResponse, error) - // Retrieves trader - QueryTraderSubaccountsInfo(ctx context.Context, in *QueryTraderSubaccountsInfoRequest, opts ...grpc.CallOption) (*QueryTraderSubaccountsInfoResponse, error) - // Retrieves undermargined accounts - QueryUnderMarginedAccounts(ctx context.Context, in *QueryUnderMarginedAccountsRequest, opts ...grpc.CallOption) (*QueryUnderMarginedAccountsResponse, error) - // Retrieves exchange params - QueryExchangeParams(ctx context.Context, in *QueryExchangeParamsRequest, opts ...grpc.CallOption) (*QueryExchangeParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) QuerySpotOrders(ctx context.Context, in *QuerySpotOrdersRequest, opts ...grpc.CallOption) (*QuerySpotOrdersResponse, error) { - out := new(QuerySpotOrdersResponse) - 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) 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) 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 - } - return out, nil -} - -func (c *queryClient) QueryDerivativeMarket(ctx context.Context, in *QueryDerivativeMarketRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketResponse, error) { - out := new(QueryDerivativeMarketResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeMarket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeMarkets(ctx context.Context, in *QueryDerivativeMarketsRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketsResponse, error) { - out := new(QueryDerivativeMarketsResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeMarkets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrders(ctx context.Context, in *QueryDerivativeOrdersRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersResponse, error) { - out := new(QueryDerivativeOrdersResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrders", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QuerySubaccountMarketDerivativeOrders(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersResponse, error) { - out := new(QuerySubaccountMarketDerivativeOrdersResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QuerySubaccountMarketDerivativeOrdersBatch(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersBatchRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersBatchResponse, error) { - out := new(QuerySubaccountMarketDerivativeOrdersBatchResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrdersQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteResponse, error) { - out := new(QueryDerivativeOrdersQuoteResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersQuote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrdersBatchQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteBatchRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteBatchResponse, error) { - out := new(QueryDerivativeOrdersQuoteBatchResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersBatchQuote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse, error) { - out := new(QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse, error) { - out := new(QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QuerySubaccountMarginHold(ctx context.Context, in *QuerySubaccountMarginHoldRequest, opts ...grpc.CallOption) (*QuerySubaccountMarginHoldResponse, error) { - out := new(QuerySubaccountMarginHoldResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarginHold", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDerivativeOrderbook(ctx context.Context, in *QueryDerivativeOrderbookRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookResponse, error) { - out := new(QueryDerivativeOrderbookResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbook", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryMarginInfo(ctx context.Context, in *QueryMarginInfoRequest, opts ...grpc.CallOption) (*QueryMarginInfoResponse, error) { - out := new(QueryMarginInfoResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryMarginInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryPositionInfo(ctx context.Context, in *QueryPositionInfoRequest, opts ...grpc.CallOption) (*QueryPositionInfoResponse, error) { - out := new(QueryPositionInfoResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryPositionInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryTraderSubaccountsInfo(ctx context.Context, in *QueryTraderSubaccountsInfoRequest, opts ...grpc.CallOption) (*QueryTraderSubaccountsInfoResponse, error) { - out := new(QueryTraderSubaccountsInfoResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryTraderSubaccountsInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryUnderMarginedAccounts(ctx context.Context, in *QueryUnderMarginedAccountsRequest, opts ...grpc.CallOption) (*QueryUnderMarginedAccountsResponse, error) { - out := new(QueryUnderMarginedAccountsResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryUnderMarginedAccounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryExchangeParams(ctx context.Context, in *QueryExchangeParamsRequest, opts ...grpc.CallOption) (*QueryExchangeParamsResponse, error) { - out := new(QueryExchangeParamsResponse) - err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryExchangeParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -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. - QuerySpotMarket(context.Context, *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) - // Retrieves a list of trade pairs. - 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. - QueryDerivativeMarkets(context.Context, *QueryDerivativeMarketsRequest) (*QueryDerivativeMarketsResponse, error) - // Retrieves a list of derivative orders matching the filtering rules. - QueryDerivativeOrders(context.Context, *QueryDerivativeOrdersRequest) (*QueryDerivativeOrdersResponse, error) - // Retrieves a list of derivative orders for a provided subaccount and - // marketID. - QuerySubaccountMarketDerivativeOrders(context.Context, *QuerySubaccountMarketDerivativeOrdersRequest) (*QuerySubaccountMarketDerivativeOrdersResponse, error) - // Retrieves a list of derivative orders for a provided subaccount and - // marketID for a batch of markets - QuerySubaccountMarketDerivativeOrdersBatch(context.Context, *QuerySubaccountMarketDerivativeOrdersBatchRequest) (*QuerySubaccountMarketDerivativeOrdersBatchResponse, error) - // Retrieves a list of orders matching a given market, direction and quantity - QueryDerivativeOrdersQuote(context.Context, *QueryDerivativeOrdersQuoteRequest) (*QueryDerivativeOrdersQuoteResponse, error) - // Retrieves a batch list of orders matching a given market, direction and quantity - QueryDerivativeOrdersBatchQuote(context.Context, *QueryDerivativeOrdersQuoteBatchRequest) (*QueryDerivativeOrdersQuoteBatchResponse, error) - // Retrieves a batch list of average weighted prices for a given derivative market, direction and quantity - QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(context.Context, *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse, error) - // Retrieves a batch list of average weighted prices for a given derivative market, direction and quantity - QueryDerivativeOrderbookDepthAvgWeightedPrice(context.Context, *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse, error) - // Retrieves a list of orders matching a given market, direction and quantity - QuerySubaccountMarginHold(context.Context, *QuerySubaccountMarginHoldRequest) (*QuerySubaccountMarginHoldResponse, error) - // Retrieves a derivative market orderbook - QueryDerivativeOrderbook(context.Context, *QueryDerivativeOrderbookRequest) (*QueryDerivativeOrderbookResponse, error) - // Retrieves a subaccount's margin info for a given base currency - QueryMarginInfo(context.Context, *QueryMarginInfoRequest) (*QueryMarginInfoResponse, error) - // Retrieves a subaccount's margin info for a given base currency - QueryPositionInfo(context.Context, *QueryPositionInfoRequest) (*QueryPositionInfoResponse, error) - // Retrieves trader - QueryTraderSubaccountsInfo(context.Context, *QueryTraderSubaccountsInfoRequest) (*QueryTraderSubaccountsInfoResponse, error) - // Retrieves undermargined accounts - QueryUnderMarginedAccounts(context.Context, *QueryUnderMarginedAccountsRequest) (*QueryUnderMarginedAccountsResponse, error) - // Retrieves exchange params - QueryExchangeParams(context.Context, *QueryExchangeParamsRequest) (*QueryExchangeParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -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) QuerySpotMarket(ctx context.Context, req *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySpotMarket 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") -} -func (*UnimplementedQueryServer) QueryDerivativeMarkets(ctx context.Context, req *QueryDerivativeMarketsRequest) (*QueryDerivativeMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeMarkets not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrders(ctx context.Context, req *QueryDerivativeOrdersRequest) (*QueryDerivativeOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrders not implemented") -} -func (*UnimplementedQueryServer) QuerySubaccountMarketDerivativeOrders(ctx context.Context, req *QuerySubaccountMarketDerivativeOrdersRequest) (*QuerySubaccountMarketDerivativeOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySubaccountMarketDerivativeOrders not implemented") -} -func (*UnimplementedQueryServer) QuerySubaccountMarketDerivativeOrdersBatch(ctx context.Context, req *QuerySubaccountMarketDerivativeOrdersBatchRequest) (*QuerySubaccountMarketDerivativeOrdersBatchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySubaccountMarketDerivativeOrdersBatch not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrdersQuote(ctx context.Context, req *QueryDerivativeOrdersQuoteRequest) (*QueryDerivativeOrdersQuoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrdersQuote not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrdersBatchQuote(ctx context.Context, req *QueryDerivativeOrdersQuoteBatchRequest) (*QueryDerivativeOrdersQuoteBatchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrdersBatchQuote not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx context.Context, req *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrderbookDepthBatchAvgWeightedPrice not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx context.Context, req *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrderbookDepthAvgWeightedPrice not implemented") -} -func (*UnimplementedQueryServer) QuerySubaccountMarginHold(ctx context.Context, req *QuerySubaccountMarginHoldRequest) (*QuerySubaccountMarginHoldResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySubaccountMarginHold not implemented") -} -func (*UnimplementedQueryServer) QueryDerivativeOrderbook(ctx context.Context, req *QueryDerivativeOrderbookRequest) (*QueryDerivativeOrderbookResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeOrderbook not implemented") -} -func (*UnimplementedQueryServer) QueryMarginInfo(ctx context.Context, req *QueryMarginInfoRequest) (*QueryMarginInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryMarginInfo not implemented") -} -func (*UnimplementedQueryServer) QueryPositionInfo(ctx context.Context, req *QueryPositionInfoRequest) (*QueryPositionInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryPositionInfo not implemented") -} -func (*UnimplementedQueryServer) QueryTraderSubaccountsInfo(ctx context.Context, req *QueryTraderSubaccountsInfoRequest) (*QueryTraderSubaccountsInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryTraderSubaccountsInfo not implemented") -} -func (*UnimplementedQueryServer) QueryUnderMarginedAccounts(ctx context.Context, req *QueryUnderMarginedAccountsRequest) (*QueryUnderMarginedAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryUnderMarginedAccounts not implemented") -} -func (*UnimplementedQueryServer) QueryExchangeParams(ctx context.Context, req *QueryExchangeParamsRequest) (*QueryExchangeParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryExchangeParams not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_QuerySpotOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySpotOrdersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySpotOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySpotOrders(ctx, req.(*QuerySpotOrdersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -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).QuerySpotMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySpotMarket(ctx, req.(*QuerySpotMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -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).QuerySpotMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySpotMarkets(ctx, req.(*QuerySpotMarketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeMarketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeMarket(ctx, req.(*QueryDerivativeMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeMarketsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeMarkets(ctx, req.(*QueryDerivativeMarketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrdersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrders(ctx, req.(*QueryDerivativeOrdersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QuerySubaccountMarketDerivativeOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySubaccountMarketDerivativeOrdersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySubaccountMarketDerivativeOrders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySubaccountMarketDerivativeOrders(ctx, req.(*QuerySubaccountMarketDerivativeOrdersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QuerySubaccountMarketDerivativeOrdersBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySubaccountMarketDerivativeOrdersBatchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySubaccountMarketDerivativeOrdersBatch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySubaccountMarketDerivativeOrdersBatch(ctx, req.(*QuerySubaccountMarketDerivativeOrdersBatchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrdersQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrdersQuoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrdersQuote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersQuote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrdersQuote(ctx, req.(*QueryDerivativeOrdersQuoteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrdersBatchQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrdersQuoteBatchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrdersBatchQuote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersBatchQuote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrdersBatchQuote(ctx, req.(*QueryDerivativeOrdersQuoteBatchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx, req.(*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx, req.(*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QuerySubaccountMarginHold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySubaccountMarginHoldRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySubaccountMarginHold(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarginHold", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySubaccountMarginHold(ctx, req.(*QuerySubaccountMarginHoldRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDerivativeOrderbook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDerivativeOrderbookRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDerivativeOrderbook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbook", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDerivativeOrderbook(ctx, req.(*QueryDerivativeOrderbookRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryMarginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMarginInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryMarginInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryMarginInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryMarginInfo(ctx, req.(*QueryMarginInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryPositionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPositionInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryPositionInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryPositionInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryPositionInfo(ctx, req.(*QueryPositionInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryTraderSubaccountsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTraderSubaccountsInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryTraderSubaccountsInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryTraderSubaccountsInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryTraderSubaccountsInfo(ctx, req.(*QueryTraderSubaccountsInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryUnderMarginedAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUnderMarginedAccountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryUnderMarginedAccounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryUnderMarginedAccounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryUnderMarginedAccounts(ctx, req.(*QueryUnderMarginedAccountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryExchangeParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryExchangeParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryExchangeParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/injective.exchange.v1beta1.Query/QueryExchangeParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryExchangeParams(ctx, req.(*QueryExchangeParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "injective.exchange.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QuerySpotOrders", - Handler: _Query_QuerySpotOrders_Handler, - }, - { - MethodName: "QuerySpotMarket", - Handler: _Query_QuerySpotMarket_Handler, - }, - { - MethodName: "QuerySpotMarkets", - Handler: _Query_QuerySpotMarkets_Handler, - }, - { - MethodName: "QueryDerivativeMarket", - Handler: _Query_QueryDerivativeMarket_Handler, - }, - { - MethodName: "QueryDerivativeMarkets", - Handler: _Query_QueryDerivativeMarkets_Handler, - }, - { - MethodName: "QueryDerivativeOrders", - Handler: _Query_QueryDerivativeOrders_Handler, - }, - { - MethodName: "QuerySubaccountMarketDerivativeOrders", - Handler: _Query_QuerySubaccountMarketDerivativeOrders_Handler, - }, - { - MethodName: "QuerySubaccountMarketDerivativeOrdersBatch", - Handler: _Query_QuerySubaccountMarketDerivativeOrdersBatch_Handler, - }, - { - MethodName: "QueryDerivativeOrdersQuote", - Handler: _Query_QueryDerivativeOrdersQuote_Handler, - }, - { - MethodName: "QueryDerivativeOrdersBatchQuote", - Handler: _Query_QueryDerivativeOrdersBatchQuote_Handler, - }, - { - MethodName: "QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", - Handler: _Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_Handler, - }, - { - MethodName: "QueryDerivativeOrderbookDepthAvgWeightedPrice", - Handler: _Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_Handler, - }, - { - MethodName: "QuerySubaccountMarginHold", - Handler: _Query_QuerySubaccountMarginHold_Handler, - }, - { - MethodName: "QueryDerivativeOrderbook", - Handler: _Query_QueryDerivativeOrderbook_Handler, - }, - { - MethodName: "QueryMarginInfo", - Handler: _Query_QueryMarginInfo_Handler, - }, - { - MethodName: "QueryPositionInfo", - Handler: _Query_QueryPositionInfo_Handler, - }, - { - MethodName: "QueryTraderSubaccountsInfo", - Handler: _Query_QueryTraderSubaccountsInfo_Handler, - }, - { - MethodName: "QueryUnderMarginedAccounts", - Handler: _Query_QueryUnderMarginedAccounts_Handler, - }, - { - MethodName: "QueryExchangeParams", - Handler: _Query_QueryExchangeParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "injective/exchange/v1beta1/query.proto", -} - -func (m *QueryExchangeParamsRequest) 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 *QueryExchangeParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExchangeParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryExchangeParamsResponse) 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 *QueryExchangeParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExchangeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersQuoteRequest) 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 *QueryDerivativeOrdersQuoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersQuoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FilterPriceBound) > 0 { - i -= len(m.FilterPriceBound) - copy(dAtA[i:], m.FilterPriceBound) - i = encodeVarintQuery(dAtA, i, uint64(len(m.FilterPriceBound))) - i-- - dAtA[i] = 0x32 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0x2a - } - if m.IsLong { - i-- - if m.IsLong { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Quantity) > 0 { - i -= len(m.Quantity) - copy(dAtA[i:], m.Quantity) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Quantity))) - i-- - dAtA[i] = 0x1a - } - 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] = 0x12 - } - 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersQuoteResponse) 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 *QueryDerivativeOrdersQuoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersQuoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Quotes) > 0 { - for iNdEx := len(m.Quotes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Quotes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersQuoteBatchRequest) 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 *QueryDerivativeOrdersQuoteBatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersQuoteBatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QuoteRequests) > 0 { - for iNdEx := len(m.QuoteRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QuoteRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersQuoteBatchResponse) 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 *QueryDerivativeOrdersQuoteBatchResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersQuoteBatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OrderQuotes) > 0 { - for iNdEx := len(m.OrderQuotes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.OrderQuotes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) 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 *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QuoteRequests) > 0 { - for iNdEx := len(m.QuoteRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QuoteRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) 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 *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvgWeightedPrice) > 0 { - for iNdEx := len(m.AvgWeightedPrice) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AvgWeightedPrice[iNdEx]) - copy(dAtA[i:], m.AvgWeightedPrice[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AvgWeightedPrice[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) 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 *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QuoteRequest != nil { - { - size, err := m.QuoteRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) 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 *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AvgWeightedPrice) > 0 { - i -= len(m.AvgWeightedPrice) - copy(dAtA[i:], m.AvgWeightedPrice) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AvgWeightedPrice))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarginHoldRequest) 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 *QuerySubaccountMarginHoldRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarginHoldRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x22 - } - if len(m.BaseCurrency) > 0 { - i -= len(m.BaseCurrency) - copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintQuery(dAtA, i, uint64(len(m.BaseCurrency))) - i-- - dAtA[i] = 0x1a - } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFee))) - i-- - dAtA[i] = 0x12 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarginHoldResponse) 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 *QuerySubaccountMarginHoldResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarginHoldResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MarginHold) > 0 { - i -= len(m.MarginHold) - copy(dAtA[i:], m.MarginHold) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MarginHold))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookRequest) 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 *QueryDerivativeOrderbookRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrderbookResponse) 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 *QueryDerivativeOrderbookResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrderbookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Longs) > 0 { - for iNdEx := len(m.Longs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Longs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Shorts) > 0 { - for iNdEx := len(m.Shorts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Shorts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryMarginInfoRequest) 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 *QueryMarginInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMarginInfoRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x2a - } - if len(m.BaseCurrency) > 0 { - i -= len(m.BaseCurrency) - copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintQuery(dAtA, i, uint64(len(m.BaseCurrency))) - i-- - dAtA[i] = 0x22 - } - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x1a - } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFee))) - i-- - dAtA[i] = 0x12 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryMarginInfoResponse) 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 *QueryMarginInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMarginInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MarginInfo != nil { - { - size, err := m.MarginInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryPositionInfoRequest) 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 *QueryPositionInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPositionInfoRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x2a - } - 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] = 0x22 - } - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x1a - } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFee))) - i-- - dAtA[i] = 0x12 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryPositionInfoResponse) 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 *QueryPositionInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPositionInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PositionInfo != nil { - { - size, err := m.PositionInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryTraderSubaccountsInfoRequest) 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 *QueryTraderSubaccountsInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTraderSubaccountsInfoRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryTraderSubaccountsInfoResponse) 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 *QueryTraderSubaccountsInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTraderSubaccountsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SubaccountInfo) > 0 { - for iNdEx := len(m.SubaccountInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SubaccountInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeMarketsRequest) 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 *QueryDerivativeMarketsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeMarketsRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeMarketsResponse) 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 *QueryDerivativeMarketsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Markets) > 0 { - for iNdEx := len(m.Markets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Markets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryUnderMarginedAccountsRequest) 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 *QueryUnderMarginedAccountsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnderMarginedAccountsRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.BaseCurrency) > 0 { - i -= len(m.BaseCurrency) - copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintQuery(dAtA, i, uint64(len(m.BaseCurrency))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryUnderMarginedAccountsResponse) 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 *QueryUnderMarginedAccountsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnderMarginedAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *UnderMarginedAccount) 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 *UnderMarginedAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UnderMarginedAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OrderPrice) > 0 { - i -= len(m.OrderPrice) - copy(dAtA[i:], m.OrderPrice) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OrderPrice))) - i-- - dAtA[i] = 0x62 - } - if m.IsLong { - i-- - if m.IsLong { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if len(m.OrderHash) > 0 { - i -= len(m.OrderHash) - copy(dAtA[i:], m.OrderHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OrderHash))) - i-- - dAtA[i] = 0x52 - } - if len(m.Nonce) > 0 { - i -= len(m.Nonce) - copy(dAtA[i:], m.Nonce) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Nonce))) - i-- - dAtA[i] = 0x4a - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0x42 - } - if len(m.SubaccountId) > 0 { - i -= len(m.SubaccountId) - copy(dAtA[i:], m.SubaccountId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountId))) - i-- - dAtA[i] = 0x3a - } - 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] = 0x32 - } - 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] = 0x2a - } - if len(m.TotalDeposits) > 0 { - i -= len(m.TotalDeposits) - copy(dAtA[i:], m.TotalDeposits) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalDeposits))) - i-- - dAtA[i] = 0x22 - } - if len(m.MarginHold) > 0 { - i -= len(m.MarginHold) - copy(dAtA[i:], m.MarginHold) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MarginHold))) - i-- - dAtA[i] = 0x1a - } - if len(m.MissingAmount) > 0 { - i -= len(m.MissingAmount) - copy(dAtA[i:], m.MissingAmount) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MissingAmount))) - i-- - dAtA[i] = 0x12 - } - if len(m.MarketName) > 0 { - i -= len(m.MarketName) - copy(dAtA[i:], m.MarketName) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MarketName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *OrderFilters) 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 *OrderFilters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OrderFilters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xca - } - if len(m.IndexPrice) > 0 { - i -= len(m.IndexPrice) - copy(dAtA[i:], m.IndexPrice) - i = encodeVarintQuery(dAtA, i, uint64(len(m.IndexPrice))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - if len(m.PriceGtOrEq) > 0 { - i -= len(m.PriceGtOrEq) - copy(dAtA[i:], m.PriceGtOrEq) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceGtOrEq))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - } - if len(m.PriceLtOrEq) > 0 { - i -= len(m.PriceLtOrEq) - copy(dAtA[i:], m.PriceLtOrEq) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceLtOrEq))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - } - if len(m.Direction) > 0 { - i -= len(m.Direction) - copy(dAtA[i:], m.Direction) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Direction))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - } - if len(m.SubaccountNonce) > 0 { - i -= len(m.SubaccountNonce) - copy(dAtA[i:], m.SubaccountNonce) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountNonce))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - } - if len(m.TakerFeeAssetData) > 0 { - i -= len(m.TakerFeeAssetData) - copy(dAtA[i:], m.TakerFeeAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFeeAssetData))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - if len(m.MakerFeeAssetData) > 0 { - i -= len(m.MakerFeeAssetData) - copy(dAtA[i:], m.MakerFeeAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerFeeAssetData))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - if len(m.FeeRecipientAddress) > 0 { - i -= len(m.FeeRecipientAddress) - copy(dAtA[i:], m.FeeRecipientAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.FeeRecipientAddress))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if len(m.TraderAddress) > 0 { - i -= len(m.TraderAddress) - copy(dAtA[i:], m.TraderAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TraderAddress))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.TakerAddress) > 0 { - i -= len(m.TakerAddress) - copy(dAtA[i:], m.TakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerAddress))) - i-- - dAtA[i] = 0x7a - } - if len(m.NotMakerAddress) > 0 { - i -= len(m.NotMakerAddress) - copy(dAtA[i:], m.NotMakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.NotMakerAddress))) - i-- - dAtA[i] = 0x72 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0x6a - } - if len(m.TakerAssetAmount) > 0 { - i -= len(m.TakerAssetAmount) - copy(dAtA[i:], m.TakerAssetAmount) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerAssetAmount))) - i-- - dAtA[i] = 0x62 - } - if len(m.MakerAssetAmount) > 0 { - i -= len(m.MakerAssetAmount) - copy(dAtA[i:], m.MakerAssetAmount) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAssetAmount))) - i-- - dAtA[i] = 0x5a - } - 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] = 0x52 - } - 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] = 0x4a - } - if len(m.SenderAddress) > 0 { - i -= len(m.SenderAddress) - copy(dAtA[i:], m.SenderAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SenderAddress))) - i-- - dAtA[i] = 0x42 - } - 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] = 0x3a - } - if len(m.TakerAssetAddress) > 0 { - i -= len(m.TakerAssetAddress) - copy(dAtA[i:], m.TakerAssetAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerAssetAddress))) - i-- - dAtA[i] = 0x32 - } - if len(m.MakerAssetAddress) > 0 { - i -= len(m.MakerAssetAddress) - copy(dAtA[i:], m.MakerAssetAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAssetAddress))) - i-- - dAtA[i] = 0x2a - } - if m.NotExpired { - i-- - if m.NotExpired { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.IsLong { - i-- - if m.IsLong { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - 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] = 0x12 - } - if len(m.ContractPriceBound) > 0 { - i -= len(m.ContractPriceBound) - copy(dAtA[i:], m.ContractPriceBound) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractPriceBound))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersRequest) 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 *QueryDerivativeOrdersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TradePairHash) > 0 { - i -= len(m.TradePairHash) - copy(dAtA[i:], m.TradePairHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TradePairHash))) - i-- - dAtA[i] = 0x22 - } - if len(m.Collection) > 0 { - i -= len(m.Collection) - copy(dAtA[i:], m.Collection) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Collection))) - i-- - dAtA[i] = 0x1a - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x12 - } - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) 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 *QuerySubaccountMarketDerivativeOrdersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x22 - } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFee))) - i-- - dAtA[i] = 0x1a - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0x12 - } - 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarketDerivativeOrdersResponse) 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 *QuerySubaccountMarketDerivativeOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarketDerivativeOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) 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 *QuerySubaccountMarketDerivativeOrdersBatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MarketIds) > 0 { - for iNdEx := len(m.MarketIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MarketIds[iNdEx]) - copy(dAtA[i:], m.MarketIds[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MarketIds[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.SubaccountID) > 0 { - i -= len(m.SubaccountID) - copy(dAtA[i:], m.SubaccountID) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SubaccountID))) - i-- - dAtA[i] = 0x1a - } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerFee))) - i-- - dAtA[i] = 0x12 - } - if len(m.MakerAddress) > 0 { - i -= len(m.MakerAddress) - copy(dAtA[i:], m.MakerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) 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 *QuerySubaccountMarketDerivativeOrdersBatchResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MarketRecords) > 0 { - for k := range m.MarketRecords { - v := m.MarketRecords[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QuerySpotOrdersRequest) 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 *QuerySpotOrdersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TradePairHash) > 0 { - i -= len(m.TradePairHash) - copy(dAtA[i:], m.TradePairHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TradePairHash))) - i-- - dAtA[i] = 0x22 - } - if len(m.Collection) > 0 { - i -= len(m.Collection) - copy(dAtA[i:], m.Collection) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Collection))) - i-- - dAtA[i] = 0x1a - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x12 - } - if m.Filters != nil { - { - size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySpotOrdersResponse) 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 *QuerySpotOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QuerySpotMarketRequest) 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 *QuerySpotMarketRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotMarketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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.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.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.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 *QuerySpotMarketResponse) 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 *QuerySpotMarketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotMarketResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeMarketRequest) 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 *QueryDerivativeMarketRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeMarketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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] = 0x12 - } - 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeMarketResponse) 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 *QueryDerivativeMarketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeMarketResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySpotMarketsRequest) 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 *QuerySpotMarketsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotMarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QuerySpotMarketsResponse) 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 *QuerySpotMarketsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDerivativeOrdersResponse) 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 *QueryDerivativeOrdersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDerivativeOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryExchangeParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryExchangeParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDerivativeOrdersQuoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Quantity) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.IsLong { - n += 2 - } - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.FilterPriceBound) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeOrdersQuoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Quotes) > 0 { - for _, e := range m.Quotes { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrdersQuoteBatchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.QuoteRequests) > 0 { - for _, e := range m.QuoteRequests { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrdersQuoteBatchResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.OrderQuotes) > 0 { - for _, e := range m.OrderQuotes { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.QuoteRequests) > 0 { - for _, e := range m.QuoteRequests { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.AvgWeightedPrice) > 0 { - for _, s := range m.AvgWeightedPrice { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QuoteRequest != nil { - l = m.QuoteRequest.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AvgWeightedPrice) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySubaccountMarginHoldRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.BaseCurrency) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySubaccountMarginHoldResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MarginHold) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeOrderbookRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeOrderbookResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Shorts) > 0 { - for _, e := range m.Shorts { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Longs) > 0 { - for _, e := range m.Longs { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryMarginInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.BaseCurrency) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryMarginInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MarginInfo != nil { - l = m.MarginInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryPositionInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryPositionInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PositionInfo != nil { - l = m.PositionInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTraderSubaccountsInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTraderSubaccountsInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SubaccountInfo) > 0 { - for _, e := range m.SubaccountInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeMarketsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeMarketsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Markets) > 0 { - for _, e := range m.Markets { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryUnderMarginedAccountsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.BaseCurrency) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryUnderMarginedAccountsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *UnderMarginedAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MarketName) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MissingAmount) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarginHold) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TotalDeposits) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Nonce) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.OrderHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.IsLong { - n += 2 - } - l = len(m.OrderPrice) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *OrderFilters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractPriceBound) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.IsLong { - n += 2 - } - if m.NotExpired { - n += 2 - } - l = len(m.MakerAssetAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerAssetAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SenderAddress) - 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.MakerAssetAmount) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerAssetAmount) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.NotMakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TraderAddress) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.FeeRecipientAddress) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.MakerFeeAssetData) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFeeAssetData) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountNonce) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.Direction) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.PriceLtOrEq) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.PriceGtOrEq) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.IndexPrice) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 2 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeOrdersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Collection) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TradePairHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySubaccountMarketDerivativeOrdersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySubaccountMarketDerivativeOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerFee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SubaccountID) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.MarketIds) > 0 { - for _, s := range m.MarketIds { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MarketRecords) > 0 { - for k, v := range m.MarketRecords { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) - } - } - return n -} - -func (m *QuerySpotOrdersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Collection) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TradePairHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySpotOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QuerySpotMarketRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Ticker) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - 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 *QuerySpotMarketResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Market != nil { - l = m.Market.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeMarketRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Ticker) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDerivativeMarketResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Market != nil { - l = m.Market.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySpotMarketsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QuerySpotMarketsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDerivativeOrdersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryExchangeParamsRequest) 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 ErrIntOverflowQuery - } - 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: QueryExchangeParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExchangeParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExchangeParamsResponse) 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 ErrIntOverflowQuery - } - 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: QueryExchangeParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExchangeParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrdersQuoteRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrdersQuoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersQuoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.ExchangeAddress = 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 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.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", 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.Quantity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowQuery - } - 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 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FilterPriceBound", 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.FilterPriceBound = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrdersQuoteResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrdersQuoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersQuoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quotes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - 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 - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrdersQuoteBatchRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrdersQuoteBatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersQuoteBatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteRequests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QuoteRequests = append(m.QuoteRequests, &QueryDerivativeOrdersQuoteRequest{}) - if err := m.QuoteRequests[len(m.QuoteRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrdersQuoteBatchResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrdersQuoteBatchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersQuoteBatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderQuotes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OrderQuotes = append(m.OrderQuotes, &OrderQuoteInfo{}) - if err := m.OrderQuotes[len(m.OrderQuotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteRequests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QuoteRequests = append(m.QuoteRequests, &QueryDerivativeOrdersQuoteRequest{}) - if err := m.QuoteRequests[len(m.QuoteRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvgWeightedPrice", 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.AvgWeightedPrice = append(m.AvgWeightedPrice, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookDepthAvgWeightedPriceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookDepthAvgWeightedPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QuoteRequest == nil { - m.QuoteRequest = &QueryDerivativeOrdersQuoteRequest{} - } - if err := m.QuoteRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookDepthAvgWeightedPriceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookDepthAvgWeightedPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvgWeightedPrice", 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.AvgWeightedPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySubaccountMarginHoldRequest) 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 ErrIntOverflowQuery - } - 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: QuerySubaccountMarginHoldRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarginHoldRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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.TakerFee = 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 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.BaseCurrency = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySubaccountMarginHoldResponse) 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 ErrIntOverflowQuery - } - 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: QuerySubaccountMarginHoldResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarginHoldResponse: 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 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.MarginHold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrderbookResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrderbookResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrderbookResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shorts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shorts = append(m.Shorts, &PriceLevel{}) - if err := m.Shorts[len(m.Shorts)-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 Longs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Longs = append(m.Longs, &PriceLevel{}) - if err := m.Longs[len(m.Longs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMarginInfoRequest) 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 ErrIntOverflowQuery - } - 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: QueryMarginInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMarginInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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.TakerFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 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.BaseCurrency = 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMarginInfoResponse) 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 ErrIntOverflowQuery - } - 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: QueryMarginInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMarginInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarginInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MarginInfo == nil { - m.MarginInfo = &MarginInfo{} - } - if err := m.MarginInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPositionInfoRequest) 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 ErrIntOverflowQuery - } - 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: QueryPositionInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPositionInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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.TakerFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 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.MarketId = 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPositionInfoResponse) 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 ErrIntOverflowQuery - } - 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: QueryPositionInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPositionInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PositionInfo == nil { - m.PositionInfo = &PositionInfo{} - } - if err := m.PositionInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTraderSubaccountsInfoRequest) 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 ErrIntOverflowQuery - } - 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: QueryTraderSubaccountsInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTraderSubaccountsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTraderSubaccountsInfoResponse) 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 ErrIntOverflowQuery - } - 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: QueryTraderSubaccountsInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTraderSubaccountsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubaccountInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SubaccountInfo = append(m.SubaccountInfo, &SubaccountInfo{}) - if err := m.SubaccountInfo[len(m.SubaccountInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeMarketsRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeMarketsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeMarketsResponse) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeMarketsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Markets = append(m.Markets, &DerivativeMarket{}) - if err := m.Markets[len(m.Markets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryUnderMarginedAccountsRequest) 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 ErrIntOverflowQuery - } - 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: QueryUnderMarginedAccountsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnderMarginedAccountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.BaseCurrency = string(dAtA[iNdEx:postIndex]) - 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryUnderMarginedAccountsResponse) 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 ErrIntOverflowQuery - } - 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: QueryUnderMarginedAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnderMarginedAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Accounts = append(m.Accounts, &UnderMarginedAccount{}) - if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UnderMarginedAccount) 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 ErrIntOverflowQuery - } - 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: UnderMarginedAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnderMarginedAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketName", 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.MarketName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MissingAmount", 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.MissingAmount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 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.MarginHold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", 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.TotalDeposits = 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 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.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - 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 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.SubaccountId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - 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 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.Nonce = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderHash", 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.OrderHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - 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 ErrIntOverflowQuery - } - 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 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderPrice", 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.OrderPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OrderFilters) 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 ErrIntOverflowQuery - } - 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: OrderFilters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OrderFilters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractPriceBound", 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.ContractPriceBound = 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 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.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowQuery - } - 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 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExpired", 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.NotExpired = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetAddress", 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.MakerAssetAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetAddress", 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.TakerAssetAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 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.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SenderAddress", 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.SenderAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - 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 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", 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.TakerAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetAmount", 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.MakerAssetAmount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetAmount", 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.TakerAssetAmount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NotMakerAddress", 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.NotMakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAddress", 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.TakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraderAddress", 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.TraderAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipientAddress", 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.FeeRecipientAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeAssetData", 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.MakerFeeAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeAssetData", 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.TakerFeeAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubaccountNonce", 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.SubaccountNonce = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Direction", 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.Direction = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceLtOrEq", 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.PriceLtOrEq = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceGtOrEq", 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.PriceGtOrEq = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 24: - 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 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.IndexPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 25: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDerivativeOrdersRequest) 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 ErrIntOverflowQuery - } - 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: QueryDerivativeOrdersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &OrderFilters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Collection", 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.Collection = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradePairHash", 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.TradePairHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySubaccountMarketDerivativeOrdersRequest) 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 ErrIntOverflowQuery - } - 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: QuerySubaccountMarketDerivativeOrdersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarketDerivativeOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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.TakerFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySubaccountMarketDerivativeOrdersResponse) 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 ErrIntOverflowQuery - } - 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: QuerySubaccountMarketDerivativeOrdersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarketDerivativeOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Records = append(m.Records, &Order{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) 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 ErrIntOverflowQuery - } - 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: QuerySubaccountMarketDerivativeOrdersBatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarketDerivativeOrdersBatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", 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.MakerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", 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.TakerFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 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.SubaccountID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketIds", 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.MarketIds = append(m.MarketIds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + var l int + _ = l + if m.Market != nil { + l = m.Market.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDerivativeMarketsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + return n +} + +func (m *QueryDerivativeMarketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Markets) > 0 { + for _, e := range m.Markets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *QueryDerivativeMarketRequest) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDerivativeMarketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Market != nil { + l = m.Market.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Unmarshal(dAtA []byte) error { +func (m *QueryExchangeParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10641,141 +1748,12 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Unmarshal(dAtA []by fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySubaccountMarketDerivativeOrdersBatchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryExchangeParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubaccountMarketDerivativeOrdersBatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryExchangeParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketRecords", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MarketRecords == nil { - m.MarketRecords = make(map[string]*QuerySubaccountMarketDerivativeOrdersResponse) - } - var mapkey string - var mapvalue *QuerySubaccountMarketDerivativeOrdersResponse - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthQuery - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthQuery - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &QuerySubaccountMarketDerivativeOrdersResponse{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.MarketRecords[mapkey] = mapvalue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -10797,7 +1775,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Unmarshal(dAtA []by } return nil } -func (m *QuerySpotOrdersRequest) Unmarshal(dAtA []byte) error { +func (m *QueryExchangeParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10819,86 +1797,18 @@ func (m *QuerySpotOrdersRequest) Unmarshal(dAtA []byte) error { } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySpotOrdersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &OrderFilters{} - } - if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + if wireType == 4 { + return fmt.Errorf("proto: QueryExchangeParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExchangeParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Collection", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -10908,27 +1818,78 @@ func (m *QuerySpotOrdersRequest) 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.Collection = string(dAtA[iNdEx:postIndex]) + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySubaccountDepositsRequest) 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 ErrIntOverflowQuery + } + 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: QuerySubaccountDepositsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySubaccountDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradePairHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10956,7 +1917,7 @@ func (m *QuerySpotOrdersRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TradePairHash = string(dAtA[iNdEx:postIndex]) + m.SubaccountId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -10979,7 +1940,7 @@ func (m *QuerySpotOrdersRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySubaccountDepositsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11002,15 +1963,15 @@ func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySpotOrdersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySubaccountDepositsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySubaccountDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11037,10 +1998,105 @@ func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Records = append(m.Records, &Order{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Deposits == nil { + m.Deposits = make(map[string]*Deposit) + } + var mapkey string + var mapvalue *Deposit + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Deposit{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Deposits[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -11063,7 +2119,7 @@ func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySubaccountDepositRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11086,15 +2142,15 @@ func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySpotMarketRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySubaccountDepositRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotMarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySubaccountDepositRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11122,11 +2178,11 @@ func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ticker = 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 ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11154,77 +2210,63 @@ func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - 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 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 + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 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 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySubaccountDepositResponse) 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 ErrIntOverflowQuery } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.BaseAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + 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: QuerySubaccountDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySubaccountDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteAsset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -11234,23 +2276,27 @@ func (m *QuerySpotMarketRequest) 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.QuoteAsset = string(dAtA[iNdEx:postIndex]) + if m.Deposits == nil { + m.Deposits = &Deposit{} + } + if err := m.Deposits.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -11273,7 +2319,7 @@ func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11296,17 +2342,17 @@ func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySpotMarketResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotMarketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpotMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var msglen int + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -11316,28 +2362,11 @@ func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Status |= MarketStatus(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Market == nil { - m.Market = &SpotMarket{} - } - if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -11359,7 +2388,7 @@ func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDerivativeMarketRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11382,17 +2411,17 @@ func (m *QueryDerivativeMarketRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDerivativeMarketRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeMarketRequest: 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: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -11402,27 +2431,79 @@ func (m *QueryDerivativeMarketRequest) 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.MarketId = string(dAtA[iNdEx:postIndex]) + m.Markets = append(m.Markets, &SpotMarket{}) + if err := m.Markets[len(m.Markets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpotMarketRequest) 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 ErrIntOverflowQuery + } + 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: QuerySpotMarketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 Ticker", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11450,7 +2531,7 @@ func (m *QueryDerivativeMarketRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ticker = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -11473,7 +2554,7 @@ func (m *QueryDerivativeMarketRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11496,10 +2577,10 @@ func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDerivativeMarketResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeMarketResponse: 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: @@ -11532,7 +2613,7 @@ func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Market == nil { - m.Market = &DerivativeMarket{} + m.Market = &SpotMarket{} } if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -11559,7 +2640,7 @@ func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySpotMarketsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDerivativeMarketsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11582,12 +2663,31 @@ func (m *QuerySpotMarketsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySpotMarketsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDerivativeMarketsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDerivativeMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= MarketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -11609,7 +2709,7 @@ func (m *QuerySpotMarketsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDerivativeMarketsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11632,15 +2732,15 @@ func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySpotMarketsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDerivativeMarketsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDerivativeMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11667,10 +2767,92 @@ func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Records = append(m.Records, &SpotMarket{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Markets = append(m.Markets, &DerivativeMarket{}) + if err := m.Markets[len(m.Markets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { return err } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDerivativeMarketRequest) 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 ErrIntOverflowQuery + } + 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: QueryDerivativeMarketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDerivativeMarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -11693,7 +2875,7 @@ func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDerivativeOrdersResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11716,15 +2898,15 @@ func (m *QueryDerivativeOrdersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDerivativeOrdersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDerivativeMarketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDerivativeOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDerivativeMarketResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11751,8 +2933,10 @@ func (m *QueryDerivativeOrdersResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Records = append(m.Records, &Order{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Market == nil { + m.Market = &DerivativeMarket{} + } + if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/chain/exchange/types/query.pb.gw.go b/chain/exchange/types/query.pb.gw.go deleted file mode 100644 index f357e1a1..00000000 --- a/chain/exchange/types/query.pb.gw.go +++ /dev/null @@ -1,1570 +0,0 @@ -// 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 deleted file mode 100644 index 03afac07..00000000 --- a/chain/exchange/types/spot_orders.go +++ /dev/null @@ -1,114 +0,0 @@ -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/exchange/types/subaccount.go b/chain/exchange/types/subaccount.go new file mode 100644 index 00000000..1132d531 --- /dev/null +++ b/chain/exchange/types/subaccount.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/ethereum/go-ethereum/common" + "math/big" +) + +type Subaccount struct { + Address common.Address + Nonce *big.Int +} + +func IsValidSubaccountID(subaccountID string) (*common.Address, bool) { + subaccountIdBytes := common.FromHex(subaccountID) + if len(subaccountIdBytes) != common.HashLength { + return nil, false + } + addressBytes := subaccountIdBytes[:common.AddressLength] + if !common.IsHexAddress(common.Bytes2Hex(addressBytes)) { + return nil, false + } + address := common.BytesToAddress(addressBytes) + return &address, true +} diff --git a/chain/exchange/types/tx.pb.go b/chain/exchange/types/tx.pb.go new file mode 100644 index 00000000..7faaa207 --- /dev/null +++ b/chain/exchange/types/tx.pb.go @@ -0,0 +1,7872 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/exchange/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// status +type MarketStatusUpdateProposal_StatusAction int32 + +const ( + MarketStatusUpdateProposal_Activate MarketStatusUpdateProposal_StatusAction = 0 + MarketStatusUpdateProposal_Pause MarketStatusUpdateProposal_StatusAction = 1 + MarketStatusUpdateProposal_Suspend MarketStatusUpdateProposal_StatusAction = 2 + MarketStatusUpdateProposal_Demolish MarketStatusUpdateProposal_StatusAction = 3 +) + +var MarketStatusUpdateProposal_StatusAction_name = map[int32]string{ + 0: "Activate", + 1: "Pause", + 2: "Suspend", + 3: "Demolish", +} + +var MarketStatusUpdateProposal_StatusAction_value = map[string]int32{ + "Activate": 0, + "Pause": 1, + "Suspend": 2, + "Demolish": 3, +} + +func (x MarketStatusUpdateProposal_StatusAction) String() string { + return proto.EnumName(MarketStatusUpdateProposal_StatusAction_name, int32(x)) +} + +func (MarketStatusUpdateProposal_StatusAction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{27, 0} +} + +// MsgDeposit defines a SDK message for transferring coins from the sender's bank balance into the subaccount's exchange deposits +type MsgDeposit struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin will be deposited to the sender's default + // subaccount address. + SubaccountId string `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } +func (*MsgDeposit) ProtoMessage() {} +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{0} +} +func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeposit.Merge(m, src) +} +func (m *MsgDeposit) XXX_Size() int { + return m.Size() +} +func (m *MsgDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo + +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{1} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + +// MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's deposits to the user's bank balance +type MsgWithdraw struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // bytes32 subaccount ID to withdraw funds from + SubaccountId string `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgWithdraw) Reset() { *m = MsgWithdraw{} } +func (m *MsgWithdraw) String() string { return proto.CompactTextString(m) } +func (*MsgWithdraw) ProtoMessage() {} +func (*MsgWithdraw) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{2} +} +func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdraw.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 *MsgWithdraw) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdraw.Merge(m, src) +} +func (m *MsgWithdraw) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdraw) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdraw.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdraw proto.InternalMessageInfo + +// MsgWithdraw defines the Msg/Withdraw response type. +type MsgWithdrawResponse struct { +} + +func (m *MsgWithdrawResponse) Reset() { *m = MsgWithdrawResponse{} } +func (m *MsgWithdrawResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawResponse) ProtoMessage() {} +func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{3} +} +func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawResponse.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 *MsgWithdrawResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawResponse.Merge(m, src) +} +func (m *MsgWithdrawResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawResponse proto.InternalMessageInfo + +// MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit order. +type MsgCreateSpotLimitOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order SpotOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` +} + +func (m *MsgCreateSpotLimitOrder) Reset() { *m = MsgCreateSpotLimitOrder{} } +func (m *MsgCreateSpotLimitOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSpotLimitOrder) ProtoMessage() {} +func (*MsgCreateSpotLimitOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{4} +} +func (m *MsgCreateSpotLimitOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSpotLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSpotLimitOrder.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 *MsgCreateSpotLimitOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSpotLimitOrder.Merge(m, src) +} +func (m *MsgCreateSpotLimitOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSpotLimitOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSpotLimitOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSpotLimitOrder proto.InternalMessageInfo + +// MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response type. +type MsgCreateSpotLimitOrderResponse struct { +} + +func (m *MsgCreateSpotLimitOrderResponse) Reset() { *m = MsgCreateSpotLimitOrderResponse{} } +func (m *MsgCreateSpotLimitOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSpotLimitOrderResponse) ProtoMessage() {} +func (*MsgCreateSpotLimitOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{5} +} +func (m *MsgCreateSpotLimitOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSpotLimitOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSpotLimitOrderResponse.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 *MsgCreateSpotLimitOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSpotLimitOrderResponse.Merge(m, src) +} +func (m *MsgCreateSpotLimitOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSpotLimitOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSpotLimitOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSpotLimitOrderResponse proto.InternalMessageInfo + +// MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot market by paying listing fee without governance +type MsgInstantSpotMarketLaunch struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // Ticker for the spot market. + Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` + // type of coin to use as the base currency + BaseDenom string `protobuf:"bytes,3,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // type of coin to use as the quote currency + QuoteDenom string `protobuf:"bytes,4,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` +} + +func (m *MsgInstantSpotMarketLaunch) Reset() { *m = MsgInstantSpotMarketLaunch{} } +func (m *MsgInstantSpotMarketLaunch) String() string { return proto.CompactTextString(m) } +func (*MsgInstantSpotMarketLaunch) ProtoMessage() {} +func (*MsgInstantSpotMarketLaunch) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{6} +} +func (m *MsgInstantSpotMarketLaunch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInstantSpotMarketLaunch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInstantSpotMarketLaunch.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 *MsgInstantSpotMarketLaunch) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInstantSpotMarketLaunch.Merge(m, src) +} +func (m *MsgInstantSpotMarketLaunch) XXX_Size() int { + return m.Size() +} +func (m *MsgInstantSpotMarketLaunch) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInstantSpotMarketLaunch.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInstantSpotMarketLaunch proto.InternalMessageInfo + +// MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch response type. +type MsgInstantSpotMarketLaunchResponse struct { +} + +func (m *MsgInstantSpotMarketLaunchResponse) Reset() { *m = MsgInstantSpotMarketLaunchResponse{} } +func (m *MsgInstantSpotMarketLaunchResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInstantSpotMarketLaunchResponse) ProtoMessage() {} +func (*MsgInstantSpotMarketLaunchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{7} +} +func (m *MsgInstantSpotMarketLaunchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInstantSpotMarketLaunchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInstantSpotMarketLaunchResponse.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 *MsgInstantSpotMarketLaunchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInstantSpotMarketLaunchResponse.Merge(m, src) +} +func (m *MsgInstantSpotMarketLaunchResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInstantSpotMarketLaunchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInstantSpotMarketLaunchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInstantSpotMarketLaunchResponse proto.InternalMessageInfo + +// MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market order. +type MsgCreateSpotMarketOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order SpotOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` +} + +func (m *MsgCreateSpotMarketOrder) Reset() { *m = MsgCreateSpotMarketOrder{} } +func (m *MsgCreateSpotMarketOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSpotMarketOrder) ProtoMessage() {} +func (*MsgCreateSpotMarketOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{8} +} +func (m *MsgCreateSpotMarketOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSpotMarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSpotMarketOrder.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 *MsgCreateSpotMarketOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSpotMarketOrder.Merge(m, src) +} +func (m *MsgCreateSpotMarketOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSpotMarketOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSpotMarketOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSpotMarketOrder proto.InternalMessageInfo + +// MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder response type. +type MsgCreateSpotMarketOrderResponse struct { +} + +func (m *MsgCreateSpotMarketOrderResponse) Reset() { *m = MsgCreateSpotMarketOrderResponse{} } +func (m *MsgCreateSpotMarketOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSpotMarketOrderResponse) ProtoMessage() {} +func (*MsgCreateSpotMarketOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{9} +} +func (m *MsgCreateSpotMarketOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSpotMarketOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSpotMarketOrderResponse.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 *MsgCreateSpotMarketOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSpotMarketOrderResponse.Merge(m, src) +} +func (m *MsgCreateSpotMarketOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSpotMarketOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSpotMarketOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSpotMarketOrderResponse proto.InternalMessageInfo + +// A Cosmos-SDK MsgCreateDerivativeLimitOrder +type MsgCreateDerivativeLimitOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order DerivativeOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` +} + +func (m *MsgCreateDerivativeLimitOrder) Reset() { *m = MsgCreateDerivativeLimitOrder{} } +func (m *MsgCreateDerivativeLimitOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDerivativeLimitOrder) ProtoMessage() {} +func (*MsgCreateDerivativeLimitOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{10} +} +func (m *MsgCreateDerivativeLimitOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDerivativeLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDerivativeLimitOrder.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 *MsgCreateDerivativeLimitOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDerivativeLimitOrder.Merge(m, src) +} +func (m *MsgCreateDerivativeLimitOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDerivativeLimitOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDerivativeLimitOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDerivativeLimitOrder proto.InternalMessageInfo + +// MsgCreateDerivativeLimitOrderResponse defines the Msg/CreateDerivativeMarketOrder response type. +type MsgCreateDerivativeLimitOrderResponse struct { +} + +func (m *MsgCreateDerivativeLimitOrderResponse) Reset() { *m = MsgCreateDerivativeLimitOrderResponse{} } +func (m *MsgCreateDerivativeLimitOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDerivativeLimitOrderResponse) ProtoMessage() {} +func (*MsgCreateDerivativeLimitOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{11} +} +func (m *MsgCreateDerivativeLimitOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDerivativeLimitOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDerivativeLimitOrderResponse.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 *MsgCreateDerivativeLimitOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDerivativeLimitOrderResponse.Merge(m, src) +} +func (m *MsgCreateDerivativeLimitOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDerivativeLimitOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDerivativeLimitOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDerivativeLimitOrderResponse proto.InternalMessageInfo + +// MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. +type MsgCancelSpotOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + IsBuy bool `protobuf:"varint,3,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"` + SubaccountId string `protobuf:"bytes,4,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + OrderHash string `protobuf:"bytes,5,opt,name=order_hash,json=orderHash,proto3" json:"order_hash,omitempty"` +} + +func (m *MsgCancelSpotOrder) Reset() { *m = MsgCancelSpotOrder{} } +func (m *MsgCancelSpotOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCancelSpotOrder) ProtoMessage() {} +func (*MsgCancelSpotOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{12} +} +func (m *MsgCancelSpotOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelSpotOrder.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 *MsgCancelSpotOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelSpotOrder.Merge(m, src) +} +func (m *MsgCancelSpotOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelSpotOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelSpotOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelSpotOrder proto.InternalMessageInfo + +// MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. +type MsgCancelSpotOrderResponse struct { +} + +func (m *MsgCancelSpotOrderResponse) Reset() { *m = MsgCancelSpotOrderResponse{} } +func (m *MsgCancelSpotOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelSpotOrderResponse) ProtoMessage() {} +func (*MsgCancelSpotOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{13} +} +func (m *MsgCancelSpotOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelSpotOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelSpotOrderResponse.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 *MsgCancelSpotOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelSpotOrderResponse.Merge(m, src) +} +func (m *MsgCancelSpotOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelSpotOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelSpotOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelSpotOrderResponse proto.InternalMessageInfo + +// A Cosmos-SDK MsgCreateDerivativeMarketOrder +type MsgCreateDerivativeMarketOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order DerivativeOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order"` +} + +func (m *MsgCreateDerivativeMarketOrder) Reset() { *m = MsgCreateDerivativeMarketOrder{} } +func (m *MsgCreateDerivativeMarketOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDerivativeMarketOrder) ProtoMessage() {} +func (*MsgCreateDerivativeMarketOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{14} +} +func (m *MsgCreateDerivativeMarketOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDerivativeMarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDerivativeMarketOrder.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 *MsgCreateDerivativeMarketOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDerivativeMarketOrder.Merge(m, src) +} +func (m *MsgCreateDerivativeMarketOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDerivativeMarketOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDerivativeMarketOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDerivativeMarketOrder proto.InternalMessageInfo + +// MsgCreateDerivativeMarketOrderResponse defines the Msg/CreateDerivativeMarketOrder response type. +type MsgCreateDerivativeMarketOrderResponse struct { +} + +func (m *MsgCreateDerivativeMarketOrderResponse) Reset() { + *m = MsgCreateDerivativeMarketOrderResponse{} +} +func (m *MsgCreateDerivativeMarketOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDerivativeMarketOrderResponse) ProtoMessage() {} +func (*MsgCreateDerivativeMarketOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{15} +} +func (m *MsgCreateDerivativeMarketOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDerivativeMarketOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDerivativeMarketOrderResponse.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 *MsgCreateDerivativeMarketOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDerivativeMarketOrderResponse.Merge(m, src) +} +func (m *MsgCreateDerivativeMarketOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDerivativeMarketOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDerivativeMarketOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDerivativeMarketOrderResponse proto.InternalMessageInfo + +// MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. +type MsgCancelDerivativeOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + IsBuy bool `protobuf:"varint,3,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"` + SubaccountId string `protobuf:"bytes,4,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` + OrderHash string `protobuf:"bytes,5,opt,name=order_hash,json=orderHash,proto3" json:"order_hash,omitempty"` +} + +func (m *MsgCancelDerivativeOrder) Reset() { *m = MsgCancelDerivativeOrder{} } +func (m *MsgCancelDerivativeOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCancelDerivativeOrder) ProtoMessage() {} +func (*MsgCancelDerivativeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{16} +} +func (m *MsgCancelDerivativeOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelDerivativeOrder.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 *MsgCancelDerivativeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelDerivativeOrder.Merge(m, src) +} +func (m *MsgCancelDerivativeOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelDerivativeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelDerivativeOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelDerivativeOrder proto.InternalMessageInfo + +// MsgCancelDerivativeOrderResponse defines the Msg/CancelDerivativeOrderResponse response type. +type MsgCancelDerivativeOrderResponse struct { +} + +func (m *MsgCancelDerivativeOrderResponse) Reset() { *m = MsgCancelDerivativeOrderResponse{} } +func (m *MsgCancelDerivativeOrderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelDerivativeOrderResponse) ProtoMessage() {} +func (*MsgCancelDerivativeOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{17} +} +func (m *MsgCancelDerivativeOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelDerivativeOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelDerivativeOrderResponse.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 *MsgCancelDerivativeOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelDerivativeOrderResponse.Merge(m, src) +} +func (m *MsgCancelDerivativeOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelDerivativeOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelDerivativeOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelDerivativeOrderResponse proto.InternalMessageInfo + +// A Cosmos-SDK MsgSubaccountTransfer +type MsgSubaccountTransfer struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SourceSubaccountId string `protobuf:"bytes,2,opt,name=source_subaccount_id,json=sourceSubaccountId,proto3" json:"source_subaccount_id,omitempty"` + DestinationSubaccountId string `protobuf:"bytes,3,opt,name=destination_subaccount_id,json=destinationSubaccountId,proto3" json:"destination_subaccount_id,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgSubaccountTransfer) Reset() { *m = MsgSubaccountTransfer{} } +func (m *MsgSubaccountTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgSubaccountTransfer) ProtoMessage() {} +func (*MsgSubaccountTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{18} +} +func (m *MsgSubaccountTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubaccountTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubaccountTransfer.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 *MsgSubaccountTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubaccountTransfer.Merge(m, src) +} +func (m *MsgSubaccountTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgSubaccountTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubaccountTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubaccountTransfer proto.InternalMessageInfo + +func (m *MsgSubaccountTransfer) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgSubaccountTransfer) GetSourceSubaccountId() string { + if m != nil { + return m.SourceSubaccountId + } + return "" +} + +func (m *MsgSubaccountTransfer) GetDestinationSubaccountId() string { + if m != nil { + return m.DestinationSubaccountId + } + return "" +} + +func (m *MsgSubaccountTransfer) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response type. +type MsgSubaccountTransferResponse struct { +} + +func (m *MsgSubaccountTransferResponse) Reset() { *m = MsgSubaccountTransferResponse{} } +func (m *MsgSubaccountTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubaccountTransferResponse) ProtoMessage() {} +func (*MsgSubaccountTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{19} +} +func (m *MsgSubaccountTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubaccountTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubaccountTransferResponse.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 *MsgSubaccountTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubaccountTransferResponse.Merge(m, src) +} +func (m *MsgSubaccountTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubaccountTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubaccountTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubaccountTransferResponse proto.InternalMessageInfo + +// A Cosmos-SDK MsgExternalTransfer +type MsgExternalTransfer struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SourceSubaccountId string `protobuf:"bytes,2,opt,name=source_subaccount_id,json=sourceSubaccountId,proto3" json:"source_subaccount_id,omitempty"` + DestinationSubaccountId string `protobuf:"bytes,3,opt,name=destination_subaccount_id,json=destinationSubaccountId,proto3" json:"destination_subaccount_id,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgExternalTransfer) Reset() { *m = MsgExternalTransfer{} } +func (m *MsgExternalTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgExternalTransfer) ProtoMessage() {} +func (*MsgExternalTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{20} +} +func (m *MsgExternalTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExternalTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExternalTransfer.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 *MsgExternalTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExternalTransfer.Merge(m, src) +} +func (m *MsgExternalTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgExternalTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExternalTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExternalTransfer proto.InternalMessageInfo + +func (m *MsgExternalTransfer) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgExternalTransfer) GetSourceSubaccountId() string { + if m != nil { + return m.SourceSubaccountId + } + return "" +} + +func (m *MsgExternalTransfer) GetDestinationSubaccountId() string { + if m != nil { + return m.DestinationSubaccountId + } + return "" +} + +func (m *MsgExternalTransfer) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. +type MsgExternalTransferResponse struct { +} + +func (m *MsgExternalTransferResponse) Reset() { *m = MsgExternalTransferResponse{} } +func (m *MsgExternalTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExternalTransferResponse) ProtoMessage() {} +func (*MsgExternalTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{21} +} +func (m *MsgExternalTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExternalTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExternalTransferResponse.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 *MsgExternalTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExternalTransferResponse.Merge(m, src) +} +func (m *MsgExternalTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExternalTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExternalTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExternalTransferResponse proto.InternalMessageInfo + +type SpotMarketParamUpdateProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // maker_fee_rate defines the trade fee rate for makers on the spot market + MakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=maker_fee_rate,json=makerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maker_fee_rate"` + // taker_fee_rate defines the trade fee rate for takers on the spot market + TakerFeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=taker_fee_rate,json=takerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"taker_fee_rate"` + // relayer_fee_share_rate defines the relayer fee share rate for the spot market + RelayerFeeShareRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=relayer_fee_share_rate,json=relayerFeeShareRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"relayer_fee_share_rate"` +} + +func (m *SpotMarketParamUpdateProposal) Reset() { *m = SpotMarketParamUpdateProposal{} } +func (m *SpotMarketParamUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*SpotMarketParamUpdateProposal) ProtoMessage() {} +func (*SpotMarketParamUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{22} +} +func (m *SpotMarketParamUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotMarketParamUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotMarketParamUpdateProposal.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 *SpotMarketParamUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotMarketParamUpdateProposal.Merge(m, src) +} +func (m *SpotMarketParamUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *SpotMarketParamUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SpotMarketParamUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SpotMarketParamUpdateProposal proto.InternalMessageInfo + +// SpotMarketLaunchProposal defines a SDK message for proposing a new spot market through governance +type SpotMarketLaunchProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Ticker for the spot market. + Ticker string `protobuf:"bytes,3,opt,name=ticker,proto3" json:"ticker,omitempty"` + // type of coin to use as the base currency + BaseDenom string `protobuf:"bytes,4,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // type of coin to use as the quote currency + QuoteDenom string `protobuf:"bytes,5,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` +} + +func (m *SpotMarketLaunchProposal) Reset() { *m = SpotMarketLaunchProposal{} } +func (m *SpotMarketLaunchProposal) String() string { return proto.CompactTextString(m) } +func (*SpotMarketLaunchProposal) ProtoMessage() {} +func (*SpotMarketLaunchProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{23} +} +func (m *SpotMarketLaunchProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotMarketLaunchProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotMarketLaunchProposal.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 *SpotMarketLaunchProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotMarketLaunchProposal.Merge(m, src) +} +func (m *SpotMarketLaunchProposal) XXX_Size() int { + return m.Size() +} +func (m *SpotMarketLaunchProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SpotMarketLaunchProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SpotMarketLaunchProposal proto.InternalMessageInfo + +// SpotMarketStatusSetProposal defines a SDK message for proposing to set spot market status through governance +type SpotMarketStatusSetProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // type of coin to use as the base currency + BaseDenom string `protobuf:"bytes,3,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // type of coin to use as the quote currency + QuoteDenom string `protobuf:"bytes,4,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` + // Status of the market + Status MarketStatus `protobuf:"varint,5,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` +} + +func (m *SpotMarketStatusSetProposal) Reset() { *m = SpotMarketStatusSetProposal{} } +func (m *SpotMarketStatusSetProposal) String() string { return proto.CompactTextString(m) } +func (*SpotMarketStatusSetProposal) ProtoMessage() {} +func (*SpotMarketStatusSetProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{24} +} +func (m *SpotMarketStatusSetProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotMarketStatusSetProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotMarketStatusSetProposal.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 *SpotMarketStatusSetProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotMarketStatusSetProposal.Merge(m, src) +} +func (m *SpotMarketStatusSetProposal) XXX_Size() int { + return m.Size() +} +func (m *SpotMarketStatusSetProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SpotMarketStatusSetProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SpotMarketStatusSetProposal proto.InternalMessageInfo + +// PerpetualMarketLaunchProposal defines a SDK message for proposing a new perpetual futures market through governance +type PerpetualMarketLaunchProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Ticker for the derivative market. + Ticker string `protobuf:"bytes,3,opt,name=ticker,proto3" json:"ticker,omitempty"` + // type of coin to use as the base currency + QuoteDenom string `protobuf:"bytes,4,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` + // Address of the oracle for the derivative contract + Oracle string `protobuf:"bytes,5,opt,name=oracle,proto3" json:"oracle,omitempty"` +} + +func (m *PerpetualMarketLaunchProposal) Reset() { *m = PerpetualMarketLaunchProposal{} } +func (m *PerpetualMarketLaunchProposal) String() string { return proto.CompactTextString(m) } +func (*PerpetualMarketLaunchProposal) ProtoMessage() {} +func (*PerpetualMarketLaunchProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{25} +} +func (m *PerpetualMarketLaunchProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PerpetualMarketLaunchProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PerpetualMarketLaunchProposal.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 *PerpetualMarketLaunchProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_PerpetualMarketLaunchProposal.Merge(m, src) +} +func (m *PerpetualMarketLaunchProposal) XXX_Size() int { + return m.Size() +} +func (m *PerpetualMarketLaunchProposal) XXX_DiscardUnknown() { + xxx_messageInfo_PerpetualMarketLaunchProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_PerpetualMarketLaunchProposal proto.InternalMessageInfo + +// ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new expiry futures market through governance +type ExpiryFuturesMarketLaunchProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Ticker for the derivative market. + Ticker string `protobuf:"bytes,3,opt,name=ticker,proto3" json:"ticker,omitempty"` + // type of coin to use as the quote currency + QuoteDenom string `protobuf:"bytes,4,opt,name=quote_denom,json=quoteDenom,proto3" json:"quote_denom,omitempty"` + // Address of the oracle for the derivative market + Oracle string `protobuf:"bytes,5,opt,name=oracle,proto3" json:"oracle,omitempty"` + // Expiration time of the market + Expiry int64 `protobuf:"varint,6,opt,name=expiry,proto3" json:"expiry,omitempty"` +} + +func (m *ExpiryFuturesMarketLaunchProposal) Reset() { *m = ExpiryFuturesMarketLaunchProposal{} } +func (m *ExpiryFuturesMarketLaunchProposal) String() string { return proto.CompactTextString(m) } +func (*ExpiryFuturesMarketLaunchProposal) ProtoMessage() {} +func (*ExpiryFuturesMarketLaunchProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{26} +} +func (m *ExpiryFuturesMarketLaunchProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExpiryFuturesMarketLaunchProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExpiryFuturesMarketLaunchProposal.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 *ExpiryFuturesMarketLaunchProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExpiryFuturesMarketLaunchProposal.Merge(m, src) +} +func (m *ExpiryFuturesMarketLaunchProposal) XXX_Size() int { + return m.Size() +} +func (m *ExpiryFuturesMarketLaunchProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ExpiryFuturesMarketLaunchProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ExpiryFuturesMarketLaunchProposal proto.InternalMessageInfo + +// TODO: think about how to properly do MarketStatusUpdateProposal +type MarketStatusUpdateProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + Action MarketStatusUpdateProposal_StatusAction `protobuf:"varint,4,opt,name=action,proto3,enum=injective.exchange.v1beta1.MarketStatusUpdateProposal_StatusAction" json:"action,omitempty"` +} + +func (m *MarketStatusUpdateProposal) Reset() { *m = MarketStatusUpdateProposal{} } +func (m *MarketStatusUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*MarketStatusUpdateProposal) ProtoMessage() {} +func (*MarketStatusUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{27} +} +func (m *MarketStatusUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarketStatusUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarketStatusUpdateProposal.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 *MarketStatusUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketStatusUpdateProposal.Merge(m, src) +} +func (m *MarketStatusUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *MarketStatusUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MarketStatusUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MarketStatusUpdateProposal proto.InternalMessageInfo + +// DerivativeMarketStatusSetProposal defines a SDK message for proposing to set spot market status through governance +type DerivativeMarketStatusSetProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + Status MarketStatus `protobuf:"varint,5,opt,name=status,proto3,enum=injective.exchange.v1beta1.MarketStatus" json:"status,omitempty"` +} + +func (m *DerivativeMarketStatusSetProposal) Reset() { *m = DerivativeMarketStatusSetProposal{} } +func (m *DerivativeMarketStatusSetProposal) String() string { return proto.CompactTextString(m) } +func (*DerivativeMarketStatusSetProposal) ProtoMessage() {} +func (*DerivativeMarketStatusSetProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{28} +} +func (m *DerivativeMarketStatusSetProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DerivativeMarketStatusSetProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DerivativeMarketStatusSetProposal.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 *DerivativeMarketStatusSetProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_DerivativeMarketStatusSetProposal.Merge(m, src) +} +func (m *DerivativeMarketStatusSetProposal) XXX_Size() int { + return m.Size() +} +func (m *DerivativeMarketStatusSetProposal) XXX_DiscardUnknown() { + xxx_messageInfo_DerivativeMarketStatusSetProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_DerivativeMarketStatusSetProposal proto.InternalMessageInfo + +type DerivativeMarketParamUpdateProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // initial_margin_ratio defines the initial margin ratio for the derivative market + InitialMarginRatio *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=initial_margin_ratio,json=initialMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"initial_margin_ratio,omitempty"` + // maintenance_margin_ratio defines the maintenance margin ratio for the derivative market + MaintenanceMarginRatio *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=maintenance_margin_ratio,json=maintenanceMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maintenance_margin_ratio,omitempty"` + // maker_fee_rate defines the exchange trade fee for makers for the derivative market + MakerFeeRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=maker_fee_rate,json=makerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maker_fee_rate,omitempty"` + // taker_fee_rate defines the exchange trade fee for takers for the derivative market + TakerFeeRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=taker_fee_rate,json=takerFeeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"taker_fee_rate,omitempty"` + // relayer_fee_share_rate defines the relayer fee share rate for the derivative market + RelayerFeeShareRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=relayer_fee_share_rate,json=relayerFeeShareRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"relayer_fee_share_rate,omitempty"` +} + +func (m *DerivativeMarketParamUpdateProposal) Reset() { *m = DerivativeMarketParamUpdateProposal{} } +func (m *DerivativeMarketParamUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*DerivativeMarketParamUpdateProposal) ProtoMessage() {} +func (*DerivativeMarketParamUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bd45b74cb6d81462, []int{29} +} +func (m *DerivativeMarketParamUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DerivativeMarketParamUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DerivativeMarketParamUpdateProposal.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 *DerivativeMarketParamUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_DerivativeMarketParamUpdateProposal.Merge(m, src) +} +func (m *DerivativeMarketParamUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *DerivativeMarketParamUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_DerivativeMarketParamUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_DerivativeMarketParamUpdateProposal proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("injective.exchange.v1beta1.MarketStatusUpdateProposal_StatusAction", MarketStatusUpdateProposal_StatusAction_name, MarketStatusUpdateProposal_StatusAction_value) + proto.RegisterType((*MsgDeposit)(nil), "injective.exchange.v1beta1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "injective.exchange.v1beta1.MsgDepositResponse") + proto.RegisterType((*MsgWithdraw)(nil), "injective.exchange.v1beta1.MsgWithdraw") + proto.RegisterType((*MsgWithdrawResponse)(nil), "injective.exchange.v1beta1.MsgWithdrawResponse") + proto.RegisterType((*MsgCreateSpotLimitOrder)(nil), "injective.exchange.v1beta1.MsgCreateSpotLimitOrder") + proto.RegisterType((*MsgCreateSpotLimitOrderResponse)(nil), "injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse") + proto.RegisterType((*MsgInstantSpotMarketLaunch)(nil), "injective.exchange.v1beta1.MsgInstantSpotMarketLaunch") + proto.RegisterType((*MsgInstantSpotMarketLaunchResponse)(nil), "injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse") + proto.RegisterType((*MsgCreateSpotMarketOrder)(nil), "injective.exchange.v1beta1.MsgCreateSpotMarketOrder") + proto.RegisterType((*MsgCreateSpotMarketOrderResponse)(nil), "injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse") + proto.RegisterType((*MsgCreateDerivativeLimitOrder)(nil), "injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder") + proto.RegisterType((*MsgCreateDerivativeLimitOrderResponse)(nil), "injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse") + proto.RegisterType((*MsgCancelSpotOrder)(nil), "injective.exchange.v1beta1.MsgCancelSpotOrder") + proto.RegisterType((*MsgCancelSpotOrderResponse)(nil), "injective.exchange.v1beta1.MsgCancelSpotOrderResponse") + proto.RegisterType((*MsgCreateDerivativeMarketOrder)(nil), "injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder") + proto.RegisterType((*MsgCreateDerivativeMarketOrderResponse)(nil), "injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse") + proto.RegisterType((*MsgCancelDerivativeOrder)(nil), "injective.exchange.v1beta1.MsgCancelDerivativeOrder") + proto.RegisterType((*MsgCancelDerivativeOrderResponse)(nil), "injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse") + proto.RegisterType((*MsgSubaccountTransfer)(nil), "injective.exchange.v1beta1.MsgSubaccountTransfer") + proto.RegisterType((*MsgSubaccountTransferResponse)(nil), "injective.exchange.v1beta1.MsgSubaccountTransferResponse") + proto.RegisterType((*MsgExternalTransfer)(nil), "injective.exchange.v1beta1.MsgExternalTransfer") + proto.RegisterType((*MsgExternalTransferResponse)(nil), "injective.exchange.v1beta1.MsgExternalTransferResponse") + proto.RegisterType((*SpotMarketParamUpdateProposal)(nil), "injective.exchange.v1beta1.SpotMarketParamUpdateProposal") + proto.RegisterType((*SpotMarketLaunchProposal)(nil), "injective.exchange.v1beta1.SpotMarketLaunchProposal") + proto.RegisterType((*SpotMarketStatusSetProposal)(nil), "injective.exchange.v1beta1.SpotMarketStatusSetProposal") + proto.RegisterType((*PerpetualMarketLaunchProposal)(nil), "injective.exchange.v1beta1.PerpetualMarketLaunchProposal") + proto.RegisterType((*ExpiryFuturesMarketLaunchProposal)(nil), "injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal") + proto.RegisterType((*MarketStatusUpdateProposal)(nil), "injective.exchange.v1beta1.MarketStatusUpdateProposal") + proto.RegisterType((*DerivativeMarketStatusSetProposal)(nil), "injective.exchange.v1beta1.DerivativeMarketStatusSetProposal") + proto.RegisterType((*DerivativeMarketParamUpdateProposal)(nil), "injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal") +} + +func init() { + proto.RegisterFile("injective/exchange/v1beta1/tx.proto", fileDescriptor_bd45b74cb6d81462) +} + +var fileDescriptor_bd45b74cb6d81462 = []byte{ + // 1397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x98, 0x4f, 0x6f, 0x1b, 0xc5, + 0x1b, 0xc7, 0x33, 0xf5, 0x9f, 0x26, 0x8f, 0xf3, 0xeb, 0x2f, 0xda, 0x26, 0xa9, 0xbb, 0x21, 0x76, + 0xea, 0xd2, 0x36, 0x08, 0x75, 0x4d, 0xd3, 0xaa, 0x55, 0x0b, 0x42, 0x34, 0x49, 0x0b, 0x91, 0x6a, + 0x88, 0xd6, 0x45, 0x48, 0x70, 0x30, 0xe3, 0xdd, 0xa9, 0x3d, 0xc4, 0xde, 0x35, 0x3b, 0xb3, 0x21, + 0x91, 0x10, 0x48, 0x1c, 0xa0, 0x12, 0x20, 0xe0, 0x82, 0x10, 0x12, 0x52, 0xcf, 0x9c, 0x10, 0xe2, + 0x25, 0xf4, 0xd0, 0x13, 0xea, 0x01, 0x21, 0xc4, 0xa1, 0xa2, 0xed, 0x85, 0x97, 0x81, 0x76, 0x76, + 0x3d, 0x5e, 0x3b, 0xeb, 0xf5, 0x9f, 0x46, 0xa1, 0xe2, 0x64, 0xef, 0xec, 0xf3, 0x7c, 0x9f, 0xcf, + 0xb3, 0xfb, 0xcc, 0x3c, 0xb3, 0x03, 0x27, 0xa9, 0xf5, 0x1e, 0x31, 0x38, 0xdd, 0x26, 0x45, 0xb2, + 0x63, 0xd4, 0xb1, 0x55, 0x23, 0xc5, 0xed, 0x73, 0x55, 0xc2, 0xf1, 0xb9, 0x22, 0xdf, 0xd1, 0x5a, + 0x8e, 0xcd, 0x6d, 0x45, 0x95, 0x46, 0x5a, 0xdb, 0x48, 0x0b, 0x8c, 0xd4, 0xd9, 0x9a, 0x5d, 0xb3, + 0x85, 0x59, 0xd1, 0xfb, 0xe7, 0x7b, 0xa8, 0x39, 0xc3, 0x66, 0x4d, 0x9b, 0x15, 0xab, 0x98, 0x75, + 0xf4, 0x0c, 0x9b, 0x5a, 0xc1, 0xfd, 0xe7, 0x62, 0xc2, 0xca, 0x10, 0xc2, 0xb4, 0xf0, 0x05, 0x02, + 0x28, 0xb1, 0xda, 0x3a, 0x69, 0xd9, 0x8c, 0x72, 0x65, 0x1e, 0xd2, 0x8c, 0x58, 0x26, 0x71, 0xb2, + 0x68, 0x09, 0x2d, 0x4f, 0xe9, 0xc1, 0x95, 0x72, 0x12, 0xfe, 0xc7, 0xdc, 0x2a, 0x36, 0x0c, 0xdb, + 0xb5, 0x78, 0x85, 0x9a, 0xd9, 0x43, 0xe2, 0xf6, 0x74, 0x67, 0x70, 0xc3, 0x54, 0x2e, 0x41, 0x1a, + 0x37, 0xbd, 0xff, 0xd9, 0xc4, 0x12, 0x5a, 0xce, 0xac, 0x1c, 0xd7, 0x7c, 0x4e, 0xcd, 0xe3, 0x6c, + 0xa7, 0xa4, 0xad, 0xd9, 0xd4, 0x5a, 0x4d, 0xde, 0x7b, 0x90, 0x9f, 0xd0, 0x03, 0xf3, 0x2b, 0x93, + 0xb7, 0xef, 0xe4, 0x27, 0xfe, 0xbe, 0x93, 0x9f, 0x28, 0xcc, 0x82, 0xd2, 0xa1, 0xd1, 0x09, 0x6b, + 0xd9, 0x16, 0x23, 0x85, 0x2f, 0x11, 0x64, 0x4a, 0xac, 0xf6, 0x16, 0xe5, 0x75, 0xd3, 0xc1, 0x1f, + 0xfc, 0xeb, 0x94, 0x73, 0x70, 0x34, 0x84, 0x23, 0x31, 0x3f, 0x82, 0x63, 0x25, 0x56, 0x5b, 0x73, + 0x08, 0xe6, 0xa4, 0xdc, 0xb2, 0xf9, 0x0d, 0xda, 0xa4, 0xfc, 0x0d, 0xc7, 0x23, 0xeb, 0x47, 0x7c, + 0x15, 0x52, 0xb6, 0x67, 0x20, 0x48, 0x33, 0x2b, 0xa7, 0xb4, 0xfe, 0xb5, 0xa0, 0x79, 0x92, 0x42, + 0x2d, 0xe0, 0xf2, 0x3d, 0x43, 0x58, 0x27, 0x20, 0xdf, 0x27, 0xbe, 0x44, 0xfc, 0x16, 0x81, 0x5a, + 0x62, 0xb5, 0x0d, 0x8b, 0x71, 0x6c, 0x71, 0xcf, 0xa8, 0x84, 0x9d, 0x2d, 0xc2, 0x6f, 0x60, 0xd7, + 0x32, 0xea, 0x7d, 0x31, 0xe7, 0x21, 0xcd, 0xa9, 0xb1, 0x15, 0x70, 0x4e, 0xe9, 0xc1, 0x95, 0xb2, + 0x08, 0xe0, 0x3d, 0xb5, 0x8a, 0x49, 0x2c, 0xbb, 0x29, 0x9e, 0xe7, 0x94, 0x3e, 0xe5, 0x8d, 0xac, + 0x7b, 0x03, 0x4a, 0x1e, 0x32, 0xef, 0xbb, 0x36, 0x6f, 0xdf, 0x4f, 0x8a, 0xfb, 0x20, 0x86, 0x84, + 0x41, 0x88, 0xfd, 0x59, 0x28, 0xf4, 0xe7, 0x92, 0xf8, 0x1f, 0x43, 0xb6, 0x2b, 0x43, 0xdf, 0xe8, + 0x00, 0x1f, 0x71, 0x01, 0x96, 0xfa, 0x01, 0x48, 0xc8, 0x4f, 0x11, 0x2c, 0x4a, 0xa3, 0x75, 0xe2, + 0xd0, 0x6d, 0xec, 0x45, 0x1b, 0xa2, 0x1a, 0x5e, 0xed, 0x46, 0x7d, 0x3e, 0x0e, 0xb5, 0x23, 0x1c, + 0x01, 0x9c, 0xf4, 0x80, 0x0b, 0x67, 0xe0, 0x54, 0x2c, 0x87, 0x24, 0xfe, 0x11, 0x89, 0x69, 0xb7, + 0x86, 0x2d, 0x83, 0x34, 0xe4, 0x33, 0xe8, 0x8b, 0xb9, 0x00, 0x53, 0x4d, 0x91, 0x77, 0x67, 0x8a, + 0x4d, 0xfa, 0x03, 0x1b, 0xa6, 0x32, 0x07, 0x69, 0xca, 0x2a, 0x55, 0x77, 0x57, 0x94, 0xc3, 0xa4, + 0x9e, 0xa2, 0x6c, 0xd5, 0xdd, 0xdd, 0x3b, 0x35, 0x93, 0x11, 0x53, 0x73, 0x11, 0x40, 0xf0, 0x57, + 0xea, 0x98, 0xd5, 0xb3, 0x29, 0xbf, 0x9c, 0xc4, 0xc8, 0x6b, 0x98, 0xd5, 0x83, 0xac, 0x9e, 0x11, + 0x15, 0xdc, 0xc3, 0x2a, 0x53, 0xf9, 0x0c, 0x41, 0x2e, 0x22, 0xe9, 0x61, 0x0a, 0x65, 0x9f, 0x9f, + 0xfe, 0x32, 0x9c, 0x8e, 0x07, 0x91, 0xcc, 0x3f, 0x21, 0xbf, 0xac, 0x45, 0x4a, 0x3d, 0xca, 0x4f, + 0xe9, 0x4b, 0x08, 0xe6, 0x41, 0x14, 0xb1, 0x4c, 0xeb, 0x77, 0x04, 0x73, 0x25, 0x56, 0x2b, 0x4b, + 0xf1, 0x9b, 0x0e, 0xb6, 0xd8, 0xad, 0x98, 0x9c, 0x5e, 0x80, 0x59, 0x66, 0xbb, 0x8e, 0x41, 0x2a, + 0x51, 0xcb, 0xb8, 0xe2, 0xdf, 0x2b, 0x87, 0x61, 0xaf, 0xc0, 0x71, 0x93, 0x30, 0x4e, 0x2d, 0xcc, + 0xa9, 0x6d, 0xf5, 0xb8, 0xf9, 0xeb, 0xd1, 0xb1, 0x90, 0x41, 0x39, 0xba, 0x11, 0x24, 0x47, 0x6a, + 0x04, 0x85, 0xbc, 0x98, 0xdf, 0x7b, 0xf3, 0x92, 0x99, 0xff, 0x86, 0x44, 0x83, 0xb8, 0xb6, 0xc3, + 0x89, 0x63, 0xe1, 0xc6, 0x7f, 0x25, 0xef, 0x45, 0x58, 0x88, 0xc8, 0x4a, 0x66, 0xfd, 0x55, 0x02, + 0x16, 0x3b, 0x6b, 0xe2, 0x26, 0x76, 0x70, 0xf3, 0xcd, 0x96, 0x89, 0x39, 0xd9, 0x74, 0xec, 0x96, + 0xcd, 0x70, 0x43, 0x99, 0x85, 0x14, 0xa7, 0xbc, 0x41, 0x82, 0xf4, 0xfd, 0x0b, 0x65, 0x09, 0x32, + 0x26, 0x61, 0x86, 0x43, 0x5b, 0x1e, 0x6a, 0x90, 0x74, 0x78, 0xa8, 0xbb, 0xd6, 0x13, 0x3d, 0xb5, + 0x7e, 0x13, 0x8e, 0x34, 0xf1, 0x16, 0x71, 0x2a, 0xb7, 0x08, 0xa9, 0x38, 0x98, 0x13, 0xbf, 0xaa, + 0x57, 0x35, 0x8f, 0xfd, 0xcf, 0x07, 0xf9, 0xd3, 0x35, 0xca, 0xeb, 0x6e, 0x55, 0x33, 0xec, 0x66, + 0x31, 0xd8, 0x37, 0xf9, 0x3f, 0x67, 0x99, 0xb9, 0x55, 0xe4, 0xbb, 0x2d, 0xc2, 0xb4, 0x75, 0x62, + 0xe8, 0xd3, 0x42, 0xe5, 0x3a, 0x21, 0x3a, 0xe6, 0xc4, 0x53, 0xe5, 0xdd, 0xaa, 0xa9, 0xf1, 0x54, + 0x79, 0x58, 0xd5, 0x80, 0x79, 0x87, 0x34, 0xf0, 0x6e, 0xa0, 0xcb, 0xea, 0xd8, 0x09, 0xd4, 0x27, + 0xc7, 0x52, 0x3f, 0x1a, 0xa8, 0x5d, 0x27, 0xa4, 0xec, 0x69, 0x79, 0x41, 0x42, 0xdd, 0xea, 0x17, + 0x04, 0xd9, 0xde, 0x5e, 0xfa, 0xc4, 0x2f, 0xa3, 0xb3, 0x17, 0x48, 0xc4, 0xec, 0x05, 0x92, 0x03, + 0xf6, 0x02, 0xa9, 0x98, 0xbd, 0xc0, 0x43, 0x04, 0x0b, 0x1d, 0xec, 0x32, 0xc7, 0xdc, 0x65, 0x65, + 0xc2, 0x9f, 0x98, 0xfc, 0x09, 0x77, 0x2b, 0xca, 0x2b, 0x90, 0x66, 0x02, 0x46, 0xd0, 0x1f, 0x59, + 0x59, 0x8e, 0xeb, 0x10, 0x61, 0x78, 0x3d, 0xf0, 0x0b, 0xe5, 0xf8, 0x33, 0x82, 0xc5, 0x4d, 0xe2, + 0xb4, 0x08, 0x77, 0x71, 0xe3, 0x40, 0xde, 0xcf, 0xc0, 0xf4, 0xe6, 0x21, 0x6d, 0x3b, 0xd8, 0x68, + 0x04, 0xa5, 0xae, 0x07, 0x57, 0x21, 0xe8, 0x5f, 0x11, 0x9c, 0xb8, 0xb6, 0xd3, 0xa2, 0xce, 0xee, + 0x75, 0x97, 0xbb, 0x0e, 0x61, 0x4f, 0x35, 0xb8, 0x37, 0x4e, 0x04, 0x6d, 0x36, 0xbd, 0x84, 0x96, + 0x13, 0x7a, 0x70, 0x15, 0x4a, 0xe8, 0xbb, 0x43, 0xa0, 0x86, 0x5f, 0xd4, 0x41, 0xac, 0x57, 0xef, + 0x40, 0x1a, 0x1b, 0xc2, 0x33, 0x29, 0xaa, 0x68, 0x6d, 0xd8, 0x2a, 0xea, 0x86, 0xd3, 0xfc, 0xc1, + 0xab, 0x42, 0x4a, 0x0f, 0x24, 0x0b, 0xab, 0x30, 0x1d, 0x1e, 0x57, 0xa6, 0x61, 0xd2, 0xfb, 0xb7, + 0x8d, 0x39, 0x99, 0x99, 0x50, 0xa6, 0x20, 0xb5, 0x89, 0x5d, 0x46, 0x66, 0x90, 0x92, 0x81, 0xc3, + 0x65, 0x97, 0xb5, 0x88, 0x65, 0xce, 0x1c, 0xf2, 0xac, 0xd6, 0x49, 0xd3, 0x6e, 0x50, 0x56, 0x9f, + 0x49, 0x04, 0x1d, 0xfe, 0x2e, 0x82, 0x13, 0xbd, 0xdb, 0x96, 0xfd, 0x9b, 0x8a, 0xb1, 0x4f, 0x68, + 0x3f, 0xe7, 0xd9, 0xc3, 0x24, 0x9c, 0xec, 0x4d, 0xe3, 0xc0, 0x5a, 0xd3, 0xbb, 0x30, 0x4b, 0x2d, + 0xca, 0x29, 0x6e, 0x54, 0x9a, 0xd8, 0xa9, 0x51, 0xcb, 0x5b, 0xeb, 0xa9, 0x1d, 0x6a, 0x50, 0x68, + 0x84, 0xc5, 0x5e, 0x09, 0xb4, 0x4a, 0x42, 0x4a, 0xf7, 0x94, 0x94, 0x3a, 0x64, 0x9b, 0x98, 0x5a, + 0x9c, 0x58, 0xde, 0x56, 0xac, 0x3b, 0x4a, 0x6a, 0xac, 0x28, 0xf3, 0x21, 0xbd, 0x70, 0xa4, 0xbd, + 0x6d, 0x36, 0x3d, 0x96, 0xfe, 0xa0, 0x36, 0x7b, 0x78, 0x3c, 0xd5, 0x91, 0xdb, 0x2c, 0xda, 0xb7, + 0x36, 0xbb, 0x72, 0x37, 0x03, 0x89, 0x12, 0xab, 0x29, 0x18, 0x0e, 0xb7, 0xcf, 0x51, 0x4e, 0xc7, + 0x96, 0xac, 0x3c, 0xe1, 0x50, 0xb5, 0xe1, 0xec, 0xda, 0x7b, 0x2c, 0xc5, 0x84, 0x49, 0x79, 0x0a, + 0x72, 0x66, 0x80, 0x6f, 0xdb, 0x50, 0x2d, 0x0e, 0x69, 0x28, 0xa3, 0x7c, 0x83, 0xe0, 0x58, 0xbf, + 0x23, 0x82, 0x8b, 0x03, 0xc4, 0xfa, 0xf8, 0xa9, 0x2f, 0x8f, 0xe7, 0x27, 0x99, 0x6e, 0x23, 0x98, + 0x8d, 0x3c, 0x5a, 0x39, 0x3f, 0x40, 0x38, 0xca, 0x49, 0x7d, 0x71, 0x0c, 0x27, 0x89, 0xf2, 0x39, + 0x82, 0xb9, 0xe8, 0x33, 0x88, 0x0b, 0x43, 0xcb, 0x86, 0xbc, 0xd4, 0x97, 0xc6, 0xf1, 0x92, 0x34, + 0xbb, 0xf0, 0xff, 0xde, 0x0f, 0xf7, 0x41, 0x55, 0xd5, 0x63, 0xaf, 0x5e, 0x1c, 0xcd, 0x5e, 0x86, + 0xfe, 0x1e, 0x81, 0x1a, 0x73, 0xcc, 0x71, 0x79, 0xa8, 0xbc, 0xa2, 0x5c, 0xd5, 0xab, 0x63, 0xbb, + 0x4a, 0xb8, 0x1f, 0x10, 0x2c, 0xc4, 0x1d, 0x03, 0x5c, 0x19, 0x31, 0x44, 0xf8, 0x8d, 0xad, 0x8e, + 0xef, 0xdb, 0x5d, 0x45, 0x91, 0x9f, 0xfc, 0x17, 0x86, 0x7a, 0x1d, 0x3d, 0x5e, 0x83, 0xab, 0x28, + 0xee, 0x63, 0x5d, 0xf9, 0x04, 0x81, 0x12, 0xf1, 0xa5, 0x7e, 0x6e, 0x80, 0xe8, 0x5e, 0x17, 0xf5, + 0xf2, 0xc8, 0x2e, 0x12, 0xe2, 0x43, 0x98, 0xd9, 0xf3, 0xcd, 0x3c, 0x68, 0xf1, 0xea, 0x75, 0x50, + 0x2f, 0x8d, 0xe8, 0xd0, 0x8e, 0xbe, 0x5a, 0xbf, 0xf7, 0x28, 0x87, 0xee, 0x3f, 0xca, 0xa1, 0xbf, + 0x1e, 0xe5, 0xd0, 0xd7, 0x8f, 0x73, 0x13, 0xf7, 0x1f, 0xe7, 0x26, 0xfe, 0x78, 0x9c, 0x9b, 0x78, + 0xfb, 0xf5, 0x50, 0x9f, 0xd8, 0x68, 0x8b, 0xdf, 0xc0, 0x55, 0x56, 0x94, 0xa1, 0xce, 0x1a, 0xb6, + 0x43, 0xc2, 0x97, 0x75, 0x4c, 0xad, 0x62, 0xd3, 0x36, 0xdd, 0x06, 0x61, 0x9d, 0x53, 0x78, 0xd1, + 0x53, 0xaa, 0x69, 0x71, 0xf6, 0x7e, 0xfe, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0xd3, 0x09, + 0x83, 0x1f, 0x18, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Deposit defines a method for transferring coins from the sender's bank balance into the subaccount's exchange deposits + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + // Withdraw defines a method for withdrawing coins from a subaccount's deposits to the user's bank balance + Withdraw(ctx context.Context, in *MsgWithdraw, opts ...grpc.CallOption) (*MsgWithdrawResponse, error) + // InstantSpotMarketLaunch defines method for creating a spot market by paying listing fee without governance + InstantSpotMarketLaunch(ctx context.Context, in *MsgInstantSpotMarketLaunch, opts ...grpc.CallOption) (*MsgInstantSpotMarketLaunchResponse, error) + // CreateSpotLimitOrder defines a method for creating a new spot limit order. + CreateSpotLimitOrder(ctx context.Context, in *MsgCreateSpotLimitOrder, opts ...grpc.CallOption) (*MsgCreateSpotLimitOrderResponse, error) + // CreateSpotMarketOrder defines a method for creating a new spot market order. + CreateSpotMarketOrder(ctx context.Context, in *MsgCreateSpotMarketOrder, opts ...grpc.CallOption) (*MsgCreateSpotMarketOrderResponse, error) + // MsgCancelSpotOrder defines a method for cancelling a spot order. + CancelSpotOrder(ctx context.Context, in *MsgCancelSpotOrder, opts ...grpc.CallOption) (*MsgCancelSpotOrderResponse, error) + // CreateDerivativeLimitOrder defines a method for creating a new derivative limit order. + CreateDerivativeLimitOrder(ctx context.Context, in *MsgCreateDerivativeLimitOrder, opts ...grpc.CallOption) (*MsgCreateDerivativeLimitOrderResponse, error) + // MsgCreateDerivativeLimitOrder defines a method for creating a new derivative market order. + CreateDerivativeMarketOrder(ctx context.Context, in *MsgCreateDerivativeMarketOrder, opts ...grpc.CallOption) (*MsgCreateDerivativeMarketOrderResponse, error) + // MsgCancelDerivativeOrder defines a method for cancelling a derivative order. + CancelDerivativeOrder(ctx context.Context, in *MsgCancelDerivativeOrder, opts ...grpc.CallOption) (*MsgCancelDerivativeOrderResponse, error) + // SubaccountTransfer defines a method for transfer between subaccounts + SubaccountTransfer(ctx context.Context, in *MsgSubaccountTransfer, opts ...grpc.CallOption) (*MsgSubaccountTransferResponse, error) + // ExternalTransfer defines a method for transfer between external accounts + ExternalTransfer(ctx context.Context, in *MsgExternalTransfer, opts ...grpc.CallOption) (*MsgExternalTransferResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Withdraw(ctx context.Context, in *MsgWithdraw, opts ...grpc.CallOption) (*MsgWithdrawResponse, error) { + out := new(MsgWithdrawResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/Withdraw", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) InstantSpotMarketLaunch(ctx context.Context, in *MsgInstantSpotMarketLaunch, opts ...grpc.CallOption) (*MsgInstantSpotMarketLaunchResponse, error) { + out := new(MsgInstantSpotMarketLaunchResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/InstantSpotMarketLaunch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateSpotLimitOrder(ctx context.Context, in *MsgCreateSpotLimitOrder, opts ...grpc.CallOption) (*MsgCreateSpotLimitOrderResponse, error) { + out := new(MsgCreateSpotLimitOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CreateSpotLimitOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateSpotMarketOrder(ctx context.Context, in *MsgCreateSpotMarketOrder, opts ...grpc.CallOption) (*MsgCreateSpotMarketOrderResponse, error) { + out := new(MsgCreateSpotMarketOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CreateSpotMarketOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelSpotOrder(ctx context.Context, in *MsgCancelSpotOrder, opts ...grpc.CallOption) (*MsgCancelSpotOrderResponse, error) { + out := new(MsgCancelSpotOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CancelSpotOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateDerivativeLimitOrder(ctx context.Context, in *MsgCreateDerivativeLimitOrder, opts ...grpc.CallOption) (*MsgCreateDerivativeLimitOrderResponse, error) { + out := new(MsgCreateDerivativeLimitOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CreateDerivativeLimitOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateDerivativeMarketOrder(ctx context.Context, in *MsgCreateDerivativeMarketOrder, opts ...grpc.CallOption) (*MsgCreateDerivativeMarketOrderResponse, error) { + out := new(MsgCreateDerivativeMarketOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CreateDerivativeMarketOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelDerivativeOrder(ctx context.Context, in *MsgCancelDerivativeOrder, opts ...grpc.CallOption) (*MsgCancelDerivativeOrderResponse, error) { + out := new(MsgCancelDerivativeOrderResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/CancelDerivativeOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SubaccountTransfer(ctx context.Context, in *MsgSubaccountTransfer, opts ...grpc.CallOption) (*MsgSubaccountTransferResponse, error) { + out := new(MsgSubaccountTransferResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/SubaccountTransfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ExternalTransfer(ctx context.Context, in *MsgExternalTransfer, opts ...grpc.CallOption) (*MsgExternalTransferResponse, error) { + out := new(MsgExternalTransferResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Msg/ExternalTransfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Deposit defines a method for transferring coins from the sender's bank balance into the subaccount's exchange deposits + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + // Withdraw defines a method for withdrawing coins from a subaccount's deposits to the user's bank balance + Withdraw(context.Context, *MsgWithdraw) (*MsgWithdrawResponse, error) + // InstantSpotMarketLaunch defines method for creating a spot market by paying listing fee without governance + InstantSpotMarketLaunch(context.Context, *MsgInstantSpotMarketLaunch) (*MsgInstantSpotMarketLaunchResponse, error) + // CreateSpotLimitOrder defines a method for creating a new spot limit order. + CreateSpotLimitOrder(context.Context, *MsgCreateSpotLimitOrder) (*MsgCreateSpotLimitOrderResponse, error) + // CreateSpotMarketOrder defines a method for creating a new spot market order. + CreateSpotMarketOrder(context.Context, *MsgCreateSpotMarketOrder) (*MsgCreateSpotMarketOrderResponse, error) + // MsgCancelSpotOrder defines a method for cancelling a spot order. + CancelSpotOrder(context.Context, *MsgCancelSpotOrder) (*MsgCancelSpotOrderResponse, error) + // CreateDerivativeLimitOrder defines a method for creating a new derivative limit order. + CreateDerivativeLimitOrder(context.Context, *MsgCreateDerivativeLimitOrder) (*MsgCreateDerivativeLimitOrderResponse, error) + // MsgCreateDerivativeLimitOrder defines a method for creating a new derivative market order. + CreateDerivativeMarketOrder(context.Context, *MsgCreateDerivativeMarketOrder) (*MsgCreateDerivativeMarketOrderResponse, error) + // MsgCancelDerivativeOrder defines a method for cancelling a derivative order. + CancelDerivativeOrder(context.Context, *MsgCancelDerivativeOrder) (*MsgCancelDerivativeOrderResponse, error) + // SubaccountTransfer defines a method for transfer between subaccounts + SubaccountTransfer(context.Context, *MsgSubaccountTransfer) (*MsgSubaccountTransferResponse, error) + // ExternalTransfer defines a method for transfer between external accounts + ExternalTransfer(context.Context, *MsgExternalTransfer) (*MsgExternalTransferResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} +func (*UnimplementedMsgServer) Withdraw(ctx context.Context, req *MsgWithdraw) (*MsgWithdrawResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Withdraw not implemented") +} +func (*UnimplementedMsgServer) InstantSpotMarketLaunch(ctx context.Context, req *MsgInstantSpotMarketLaunch) (*MsgInstantSpotMarketLaunchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InstantSpotMarketLaunch not implemented") +} +func (*UnimplementedMsgServer) CreateSpotLimitOrder(ctx context.Context, req *MsgCreateSpotLimitOrder) (*MsgCreateSpotLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSpotLimitOrder not implemented") +} +func (*UnimplementedMsgServer) CreateSpotMarketOrder(ctx context.Context, req *MsgCreateSpotMarketOrder) (*MsgCreateSpotMarketOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSpotMarketOrder not implemented") +} +func (*UnimplementedMsgServer) CancelSpotOrder(ctx context.Context, req *MsgCancelSpotOrder) (*MsgCancelSpotOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelSpotOrder not implemented") +} +func (*UnimplementedMsgServer) CreateDerivativeLimitOrder(ctx context.Context, req *MsgCreateDerivativeLimitOrder) (*MsgCreateDerivativeLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDerivativeLimitOrder not implemented") +} +func (*UnimplementedMsgServer) CreateDerivativeMarketOrder(ctx context.Context, req *MsgCreateDerivativeMarketOrder) (*MsgCreateDerivativeMarketOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDerivativeMarketOrder not implemented") +} +func (*UnimplementedMsgServer) CancelDerivativeOrder(ctx context.Context, req *MsgCancelDerivativeOrder) (*MsgCancelDerivativeOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelDerivativeOrder not implemented") +} +func (*UnimplementedMsgServer) SubaccountTransfer(ctx context.Context, req *MsgSubaccountTransfer) (*MsgSubaccountTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubaccountTransfer not implemented") +} +func (*UnimplementedMsgServer) ExternalTransfer(ctx context.Context, req *MsgExternalTransfer) (*MsgExternalTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExternalTransfer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Withdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdraw) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Withdraw(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/Withdraw", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Withdraw(ctx, req.(*MsgWithdraw)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_InstantSpotMarketLaunch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInstantSpotMarketLaunch) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InstantSpotMarketLaunch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/InstantSpotMarketLaunch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InstantSpotMarketLaunch(ctx, req.(*MsgInstantSpotMarketLaunch)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateSpotLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateSpotLimitOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateSpotLimitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CreateSpotLimitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateSpotLimitOrder(ctx, req.(*MsgCreateSpotLimitOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateSpotMarketOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateSpotMarketOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateSpotMarketOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CreateSpotMarketOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateSpotMarketOrder(ctx, req.(*MsgCreateSpotMarketOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelSpotOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelSpotOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelSpotOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CancelSpotOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelSpotOrder(ctx, req.(*MsgCancelSpotOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateDerivativeLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDerivativeLimitOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDerivativeLimitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CreateDerivativeLimitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDerivativeLimitOrder(ctx, req.(*MsgCreateDerivativeLimitOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateDerivativeMarketOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDerivativeMarketOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDerivativeMarketOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CreateDerivativeMarketOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDerivativeMarketOrder(ctx, req.(*MsgCreateDerivativeMarketOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelDerivativeOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelDerivativeOrder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelDerivativeOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/CancelDerivativeOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelDerivativeOrder(ctx, req.(*MsgCancelDerivativeOrder)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SubaccountTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubaccountTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubaccountTransfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/SubaccountTransfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubaccountTransfer(ctx, req.(*MsgSubaccountTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ExternalTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExternalTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExternalTransfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.exchange.v1beta1.Msg/ExternalTransfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExternalTransfer(ctx, req.(*MsgExternalTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.exchange.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + { + MethodName: "Withdraw", + Handler: _Msg_Withdraw_Handler, + }, + { + MethodName: "InstantSpotMarketLaunch", + Handler: _Msg_InstantSpotMarketLaunch_Handler, + }, + { + MethodName: "CreateSpotLimitOrder", + Handler: _Msg_CreateSpotLimitOrder_Handler, + }, + { + MethodName: "CreateSpotMarketOrder", + Handler: _Msg_CreateSpotMarketOrder_Handler, + }, + { + MethodName: "CancelSpotOrder", + Handler: _Msg_CancelSpotOrder_Handler, + }, + { + MethodName: "CreateDerivativeLimitOrder", + Handler: _Msg_CreateDerivativeLimitOrder_Handler, + }, + { + MethodName: "CreateDerivativeMarketOrder", + Handler: _Msg_CreateDerivativeMarketOrder_Handler, + }, + { + MethodName: "CancelDerivativeOrder", + Handler: _Msg_CancelDerivativeOrder_Handler, + }, + { + MethodName: "SubaccountTransfer", + Handler: _Msg_SubaccountTransfer_Handler, + }, + { + MethodName: "ExternalTransfer", + Handler: _Msg_ExternalTransfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/exchange/v1beta1/tx.proto", +} + +func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdraw) 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 *MsgWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawResponse) 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 *MsgWithdrawResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateSpotLimitOrder) 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 *MsgCreateSpotLimitOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSpotLimitOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSpotLimitOrderResponse) 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 *MsgCreateSpotLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSpotLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgInstantSpotMarketLaunch) 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 *MsgInstantSpotMarketLaunch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantSpotMarketLaunch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.QuoteDenom))) + i-- + dAtA[i] = 0x22 + } + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BaseDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintTx(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 = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgInstantSpotMarketLaunchResponse) 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 *MsgInstantSpotMarketLaunchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantSpotMarketLaunchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateSpotMarketOrder) 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 *MsgCreateSpotMarketOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSpotMarketOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSpotMarketOrderResponse) 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 *MsgCreateSpotMarketOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSpotMarketOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateDerivativeLimitOrder) 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 *MsgCreateDerivativeLimitOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDerivativeLimitOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDerivativeLimitOrderResponse) 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 *MsgCreateDerivativeLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDerivativeLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelSpotOrder) 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 *MsgCancelSpotOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelSpotOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OrderHash) > 0 { + i -= len(m.OrderHash) + copy(dAtA[i:], m.OrderHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.OrderHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0x22 + } + if m.IsBuy { + i-- + if m.IsBuy { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(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 = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelSpotOrderResponse) 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 *MsgCancelSpotOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelSpotOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateDerivativeMarketOrder) 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 *MsgCreateDerivativeMarketOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDerivativeMarketOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDerivativeMarketOrderResponse) 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 *MsgCreateDerivativeMarketOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDerivativeMarketOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelDerivativeOrder) 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 *MsgCancelDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelDerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OrderHash) > 0 { + i -= len(m.OrderHash) + copy(dAtA[i:], m.OrderHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.OrderHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.SubaccountId) > 0 { + i -= len(m.SubaccountId) + copy(dAtA[i:], m.SubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubaccountId))) + i-- + dAtA[i] = 0x22 + } + if m.IsBuy { + i-- + if m.IsBuy { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(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 = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelDerivativeOrderResponse) 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 *MsgCancelDerivativeOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelDerivativeOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSubaccountTransfer) 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 *MsgSubaccountTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubaccountTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.DestinationSubaccountId) > 0 { + i -= len(m.DestinationSubaccountId) + copy(dAtA[i:], m.DestinationSubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DestinationSubaccountId))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourceSubaccountId) > 0 { + i -= len(m.SourceSubaccountId) + copy(dAtA[i:], m.SourceSubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceSubaccountId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubaccountTransferResponse) 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 *MsgSubaccountTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubaccountTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgExternalTransfer) 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 *MsgExternalTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExternalTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.DestinationSubaccountId) > 0 { + i -= len(m.DestinationSubaccountId) + copy(dAtA[i:], m.DestinationSubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DestinationSubaccountId))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourceSubaccountId) > 0 { + i -= len(m.SourceSubaccountId) + copy(dAtA[i:], m.SourceSubaccountId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceSubaccountId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExternalTransferResponse) 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 *MsgExternalTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExternalTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *SpotMarketParamUpdateProposal) 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 *SpotMarketParamUpdateProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpotMarketParamUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.RelayerFeeShareRate.Size() + i -= size + if _, err := m.RelayerFeeShareRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.TakerFeeRate.Size() + i -= size + if _, err := m.TakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.MakerFeeRate.Size() + i -= size + if _, err := m.MakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpotMarketLaunchProposal) 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 *SpotMarketLaunchProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpotMarketLaunchProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.QuoteDenom))) + i-- + dAtA[i] = 0x2a + } + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BaseDenom))) + i-- + dAtA[i] = 0x22 + } + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ticker))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpotMarketStatusSetProposal) 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 *SpotMarketStatusSetProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpotMarketStatusSetProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x28 + } + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.QuoteDenom))) + i-- + dAtA[i] = 0x22 + } + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BaseDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PerpetualMarketLaunchProposal) 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 *PerpetualMarketLaunchProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PerpetualMarketLaunchProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Oracle) > 0 { + i -= len(m.Oracle) + copy(dAtA[i:], m.Oracle) + i = encodeVarintTx(dAtA, i, uint64(len(m.Oracle))) + i-- + dAtA[i] = 0x2a + } + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.QuoteDenom))) + i-- + dAtA[i] = 0x22 + } + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ticker))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExpiryFuturesMarketLaunchProposal) 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 *ExpiryFuturesMarketLaunchProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExpiryFuturesMarketLaunchProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiry != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Expiry)) + i-- + dAtA[i] = 0x30 + } + if len(m.Oracle) > 0 { + i -= len(m.Oracle) + copy(dAtA[i:], m.Oracle) + i = encodeVarintTx(dAtA, i, uint64(len(m.Oracle))) + i-- + dAtA[i] = 0x2a + } + if len(m.QuoteDenom) > 0 { + i -= len(m.QuoteDenom) + copy(dAtA[i:], m.QuoteDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.QuoteDenom))) + i-- + dAtA[i] = 0x22 + } + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ticker))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MarketStatusUpdateProposal) 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 *MarketStatusUpdateProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MarketStatusUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Action != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x20 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DerivativeMarketStatusSetProposal) 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 *DerivativeMarketStatusSetProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DerivativeMarketStatusSetProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x28 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DerivativeMarketParamUpdateProposal) 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 *DerivativeMarketParamUpdateProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DerivativeMarketParamUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RelayerFeeShareRate != nil { + { + size := m.RelayerFeeShareRate.Size() + i -= size + if _, err := m.RelayerFeeShareRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.TakerFeeRate != nil { + { + size := m.TakerFeeRate.Size() + i -= size + if _, err := m.TakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.MakerFeeRate != nil { + { + size := m.MakerFeeRate.Size() + i -= size + if _, err := m.MakerFeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.MaintenanceMarginRatio != nil { + { + size := m.MaintenanceMarginRatio.Size() + i -= size + if _, err := m.MaintenanceMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.InitialMarginRatio != nil { + { + size := m.InitialMarginRatio.Size() + i -= size + if _, err := m.InitialMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgWithdrawResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateSpotLimitOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Order.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateSpotLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgInstantSpotMarketLaunch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BaseDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.QuoteDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgInstantSpotMarketLaunchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateSpotMarketOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Order.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateSpotMarketOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateDerivativeLimitOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Order.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateDerivativeLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelSpotOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.IsBuy { + n += 2 + } + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OrderHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelSpotOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateDerivativeMarketOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Order.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateDerivativeMarketOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelDerivativeOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.IsBuy { + n += 2 + } + l = len(m.SubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OrderHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelDerivativeOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubaccountTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceSubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DestinationSubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSubaccountTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgExternalTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceSubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DestinationSubaccountId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgExternalTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SpotMarketParamUpdateProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.MakerFeeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.TakerFeeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.RelayerFeeShareRate.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *SpotMarketLaunchProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BaseDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.QuoteDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *SpotMarketStatusSetProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BaseDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.QuoteDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + return n +} + +func (m *PerpetualMarketLaunchProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.QuoteDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Oracle) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ExpiryFuturesMarketLaunchProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.QuoteDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Oracle) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Expiry != 0 { + n += 1 + sovTx(uint64(m.Expiry)) + } + return n +} + +func (m *MarketStatusUpdateProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Action != 0 { + n += 1 + sovTx(uint64(m.Action)) + } + return n +} + +func (m *DerivativeMarketStatusSetProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + return n +} + +func (m *DerivativeMarketParamUpdateProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.InitialMarginRatio != nil { + l = m.InitialMarginRatio.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.MaintenanceMarginRatio != nil { + l = m.MaintenanceMarginRatio.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.MakerFeeRate != nil { + l = m.MakerFeeRate.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.TakerFeeRate != nil { + l = m.TakerFeeRate.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.RelayerFeeShareRate != nil { + l = m.RelayerFeeShareRate.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgDeposit) 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 ErrIntOverflowTx + } + 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: MsgDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeposit: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 SubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDepositResponse) 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 ErrIntOverflowTx + } + 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: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdraw) 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 ErrIntOverflowTx + } + 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: MsgWithdraw: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdraw: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 SubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawResponse) 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 ErrIntOverflowTx + } + 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: MsgWithdrawResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSpotLimitOrder) 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 ErrIntOverflowTx + } + 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: MsgCreateSpotLimitOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSpotLimitOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSpotLimitOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateSpotLimitOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSpotLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgInstantSpotMarketLaunch) 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 ErrIntOverflowTx + } + 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: MsgInstantSpotMarketLaunch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInstantSpotMarketLaunch: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 BaseDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgInstantSpotMarketLaunchResponse) 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 ErrIntOverflowTx + } + 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: MsgInstantSpotMarketLaunchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInstantSpotMarketLaunchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSpotMarketOrder) 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 ErrIntOverflowTx + } + 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: MsgCreateSpotMarketOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSpotMarketOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSpotMarketOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateSpotMarketOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSpotMarketOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDerivativeLimitOrder) 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 ErrIntOverflowTx + } + 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: MsgCreateDerivativeLimitOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDerivativeLimitOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDerivativeLimitOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateDerivativeLimitOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDerivativeLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelSpotOrder) 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 ErrIntOverflowTx + } + 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: MsgCancelSpotOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelSpotOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBuy", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsBuy = bool(v != 0) + case 4: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OrderHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelSpotOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCancelSpotOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelSpotOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDerivativeMarketOrder) 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 ErrIntOverflowTx + } + 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: MsgCreateDerivativeMarketOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDerivativeMarketOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDerivativeMarketOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCreateDerivativeMarketOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDerivativeMarketOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelDerivativeOrder) 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 ErrIntOverflowTx + } + 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: MsgCancelDerivativeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelDerivativeOrder: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBuy", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsBuy = bool(v != 0) + case 4: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OrderHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelDerivativeOrderResponse) 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 ErrIntOverflowTx + } + 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: MsgCancelDerivativeOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelDerivativeOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubaccountTransfer) 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 ErrIntOverflowTx + } + 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: MsgSubaccountTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubaccountTransfer: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 SourceSubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceSubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationSubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationSubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubaccountTransferResponse) 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 ErrIntOverflowTx + } + 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: MsgSubaccountTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubaccountTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExternalTransfer) 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 ErrIntOverflowTx + } + 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: MsgExternalTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExternalTransfer: 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 SourceSubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceSubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationSubaccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationSubaccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExternalTransferResponse) 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 ErrIntOverflowTx + } + 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: MsgExternalTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExternalTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpotMarketParamUpdateProposal) 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 ErrIntOverflowTx + } + 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: SpotMarketParamUpdateProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpotMarketParamUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFeeShareRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RelayerFeeShareRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpotMarketLaunchProposal) 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 ErrIntOverflowTx + } + 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: SpotMarketLaunchProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpotMarketLaunchProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ticker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpotMarketStatusSetProposal) 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 ErrIntOverflowTx + } + 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: SpotMarketStatusSetProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpotMarketStatusSetProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= MarketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PerpetualMarketLaunchProposal) 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 ErrIntOverflowTx + } + 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: PerpetualMarketLaunchProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PerpetualMarketLaunchProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ticker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Oracle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExpiryFuturesMarketLaunchProposal) 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 ErrIntOverflowTx + } + 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: ExpiryFuturesMarketLaunchProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExpiryFuturesMarketLaunchProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ticker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Oracle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Expiry |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MarketStatusUpdateProposal) 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 ErrIntOverflowTx + } + 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: MarketStatusUpdateProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketStatusUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + m.Action = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Action |= MarketStatusUpdateProposal_StatusAction(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DerivativeMarketStatusSetProposal) 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 ErrIntOverflowTx + } + 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: DerivativeMarketStatusSetProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DerivativeMarketStatusSetProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= MarketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DerivativeMarketParamUpdateProposal) 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 ErrIntOverflowTx + } + 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: DerivativeMarketParamUpdateProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DerivativeMarketParamUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.InitialMarginRatio = &v + if err := m.InitialMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.MaintenanceMarginRatio = &v + if err := m.MaintenanceMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.MakerFeeRate = &v + if err := m.MakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.TakerFeeRate = &v + if err := m.TakerFeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFeeShareRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.RelayerFeeShareRate = &v + if err := m.RelayerFeeShareRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/exchange/types/types.go b/chain/exchange/types/types.go deleted file mode 100644 index e6478454..00000000 --- a/chain/exchange/types/types.go +++ /dev/null @@ -1,305 +0,0 @@ -package types - -import ( - "errors" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "math/big" - "time" - - "github.com/ethereum/go-ethereum/common" - "golang.org/x/crypto/sha3" -) - -const ( - ADDRESS_LENGTH = 42 - BYTES32_LENGTH = 66 -) - -type Direction uint8 - -const ( - Long Direction = 0 - Short Direction = 1 -) - -func DirectionFromString(direction string) Direction { - switch direction { - case "long": - return Long - case "short": - return Short - default: - return Long - } - -} - -func (d Direction) String() string { - switch d { - case Long: - return "long" - case Short: - return "short" - } - return "" -} - -// Order Type denotes an order type -type OrderType uint64 - -const ( - VANILLA_LIMIT OrderType = 0 - STOP_LIMIT_PROFIT OrderType = 1 - STOP_LIMIT_LOSS OrderType = 2 - STOP_LOSS OrderType = 3 - TAKE_PROFIT OrderType = 4 - REDUCE_ONLY OrderType = 5 -) - -func ComputePositionBankruptcyPrice( - entryPrice, margin, quantity, marketCumulativeFunding, positionCumFundingEntry *big.Int, - isDirectionLong bool, -) *big.Int { - // funding fee = position quantity * (market cumulative funding - position cumulative funding entry) - fundingFee := new(big.Int).Mul(quantity, new(big.Int).Sub(marketCumulativeFunding, positionCumFundingEntry)) - - isFundingPositive := fundingFee.Cmp(big.NewInt(0)) > 0 - - // When the funding rate is positive, longs pay shorts. When negative, shorts pay longs. - longPositionGetsPaid := isDirectionLong && !isFundingPositive - longPositionPays := isDirectionLong && isFundingPositive - - shortPositionGetsPaid := !isDirectionLong && isFundingPositive - shortPositionPays := !isDirectionLong && !isFundingPositive - - netMargin := BigNum(margin.String()).Int() - - if longPositionGetsPaid || shortPositionGetsPaid { - netMargin = new(big.Int).Add(margin, fundingFee) - } else if longPositionPays || shortPositionPays { - netMargin = new(big.Int).Sub(margin, fundingFee) - } - - var bankruptcyPrice *big.Int - unitMargin := new(big.Int).Div(netMargin, quantity) - if isDirectionLong { - bankruptcyPrice = new(big.Int).Sub(entryPrice, unitMargin) - } else { - bankruptcyPrice = new(big.Int).Add(entryPrice, unitMargin) - } - return bankruptcyPrice -} - -// OrderStatus encodes order status according to LibOrder.OrderStatus -type OrderStatus uint8 - -const ( - // StatusInvalid is the default value - StatusInvalid OrderStatus = 0 - // StatusInsufficientMarginForContractPrice when Order does not have enough margin for contract price - StatusInsufficientMarginForContractPrice OrderStatus = 1 - // StatusInsufficientMarginIndexPrice when Order does not have enough margin for index price - StatusInsufficientMarginIndexPrice OrderStatus = 2 - // StatusFillable when order is fillable - StatusFillable OrderStatus = 3 - // StatusExpired when order has already expired - StatusExpired OrderStatus = 4 - // StatusFullyFilled when order is fully filled - StatusFullyFilled OrderStatus = 5 - // StatusCancelled when order has been cancelled - StatusCancelled OrderStatus = 6 - // Maker of the order does not have sufficient funds deposited to be filled. - StatusUnfunded OrderStatus = 7 - // Index Price has not been triggered - StatusUntriggered OrderStatus = 8 - // StatusInvalidTriggerPrice TakeProfit trigger price is lower than contract price or StopLoss trigger price is higher than contract price - StatusInvalidTriggerPrice OrderStatus = 9 - // StatusReduceOnlyExpired when order has expired due to a reduce only condition invalidation - StatusReduceOnlyExpired OrderStatus = 10 - // StatusSoftCancelled when order has been soft-cancelled - StatusSoftCancelled OrderStatus = 11 -) - -func (o OrderStatus) String() string { - switch o { - case StatusInvalid: - return "invalid" - case StatusInsufficientMarginForContractPrice: - return "insufficientMarginForContractPrice" - case StatusInsufficientMarginIndexPrice: - return "insufficientMarginIndexPrice" - case StatusFillable: - return "fillable" - case StatusExpired: - return "expired" - case StatusFullyFilled: - return "fullyFilled" - case StatusCancelled: - return "cancelled" - case StatusUnfunded: - return "unfunded" - case StatusUntriggered: - return "untriggered" - case StatusInvalidTriggerPrice: - return "invalidTriggerPrice" - case StatusReduceOnlyExpired: - return "reduceOnlyExpired" - case StatusSoftCancelled: - return "softCancelled" - default: - return "" - } -} - -func OrderStatusFromString(status string) OrderStatus { - switch status { - case "invalid": - return StatusInvalid - case "insufficientMarginForContractPrice": - return StatusInsufficientMarginForContractPrice - case "insufficientMarginIndexPrice": - return StatusInsufficientMarginIndexPrice - case "fillable": - return StatusFillable - case "expired": - return StatusExpired - case "fullyFilled": - return StatusFullyFilled - case "cancelled": - return StatusCancelled - case "unfunded": - return StatusUnfunded - case "untriggered": - return StatusUntriggered - case "invalidtriggerprice": - return StatusInvalidTriggerPrice - case "reduceOnlyExpired": - return StatusReduceOnlyExpired - case "softCancelled": - return StatusSoftCancelled - default: - return StatusInvalid - } -} - -//type OrderSoftCancelRequest struct { -// TxHash common.Hash `json:"txHash"` -// OrderHash common.Hash `json:"orderHash"` -// ApprovalSignatures [][]byte `json:"approvalSignatures"` -//} - -type Hash struct { - common.Hash -} - -func (h Hash) MarshalJSON() ([]byte, error) { - hex := h.Hash.Hex() - buf := make([]byte, 0, len(hex)+2) - buf = append(buf, '"') - buf = append(buf, hex...) - buf = append(buf, '"') - return buf, nil -} - -type HexBytes []byte - -func (h HexBytes) MarshalJSON() ([]byte, error) { - hex := common.Bytes2Hex(h) - buf := make([]byte, 0, len(hex)+2) - buf = append(buf, '"') - buf = append(buf, hex...) - buf = append(buf, '"') - return buf, nil -} - -func (h *HexBytes) UnmarshalJSON(src []byte) error { - if len(src) == 2 { - return nil - } else if len(src) < 2 { - return errors.New("failed to parse: " + string(src)) - } - - *h = HexBytes(common.FromHex(string(src[1 : len(src)-1]))) - return nil -} - -func (h HexBytes) String() string { - return common.Bytes2Hex([]byte(h)) -} - -type Address struct { - common.Address -} - -func (a Address) MarshalJSON() ([]byte, error) { - hex := a.Address.Hex() - buf := make([]byte, 0, len(hex)+2) - buf = append(buf, '"') - buf = append(buf, hex...) - buf = append(buf, '"') - return buf, nil -} - -const nullAddressHex = "0x0000000000000000000000000000000000000000" - -func (a Address) IsEmpty() bool { - if a.Hex() == nullAddressHex { - return true - } - - return false -} - -type BigNum string - -func (n BigNum) Int() *big.Int { - i := new(big.Int) - i.SetString(string(n), 10) - return i -} - -func NewBigNum(i *big.Int) BigNum { - if i == nil { - return "0" - } - return BigNum(i.String()) -} - -func (m MarginInfo) IsMarginHoldBreached() (availableMargin *big.Int, isBreached bool) { - availableMargin = new(big.Int).Sub(BigNum(m.GetTotalDeposits()).Int(), BigNum(m.GetMarginHold()).Int()) - if availableMargin.Cmp(big.NewInt(0)) < 0 { - return availableMargin, true - } - return availableMargin, false -} - - -func GetMarketIdFromAssetPair(baseAsset common.Address, quoteAsset common.Address, exchangeAddress common.Address) common.Hash { - return common.BytesToHash(keccak256(baseAsset.Bytes(), quoteAsset.Bytes(), exchangeAddress.Bytes())) -} - -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 { - nextFundingTimestamp, fundingInterval := BigNum(m.GetNextFundingTimestamp()).Int(), BigNum(m.GetFundingInterval()).Int() - if fundingInterval.Cmp(big.NewInt(0)) == 0 { - // expiration time must be greater than current block time - if nextFundingTimestamp.Cmp(big.NewInt(currBlockTime.Unix())) <= 0 { - return sdkerrors.Wrap(ErrMarketExpired, m.GetTicker()) - } - } - return nil -} - -// keccak256 calculates and returns the Keccak256 hash of the input data. -func keccak256(data ...[]byte) []byte { - d := sha3.NewLegacyKeccak256() - for _, b := range data { - _, _ = d.Write(b) - } - return d.Sum(nil) -} \ No newline at end of file