// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: provenance/exchange/v1/market.proto

package exchange

import (
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	types1 "github.com/cosmos/cosmos-sdk/types"
	types "github.com/cosmos/cosmos-sdk/x/auth/types"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/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

// Permission defines the different types of permission that can be given to an account for a market.
type Permission int32

const (
	// PERMISSION_UNSPECIFIED is the zero-value Permission; it is an error to use it.
	Permission_unspecified Permission = 0
	// PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market.
	Permission_settle Permission = 1
	// PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market.
	Permission_set_ids Permission = 2
	// PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market.
	Permission_cancel Permission = 3
	// PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint.
	Permission_withdraw Permission = 4
	// PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints.
	Permission_update Permission = 5
	// PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint.
	Permission_permissions Permission = 6
	// PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint.
	Permission_attributes Permission = 7
)

var Permission_name = map[int32]string{
	0: "PERMISSION_UNSPECIFIED",
	1: "PERMISSION_SETTLE",
	2: "PERMISSION_SET_IDS",
	3: "PERMISSION_CANCEL",
	4: "PERMISSION_WITHDRAW",
	5: "PERMISSION_UPDATE",
	6: "PERMISSION_PERMISSIONS",
	7: "PERMISSION_ATTRIBUTES",
}

var Permission_value = map[string]int32{
	"PERMISSION_UNSPECIFIED": 0,
	"PERMISSION_SETTLE":      1,
	"PERMISSION_SET_IDS":     2,
	"PERMISSION_CANCEL":      3,
	"PERMISSION_WITHDRAW":    4,
	"PERMISSION_UPDATE":      5,
	"PERMISSION_PERMISSIONS": 6,
	"PERMISSION_ATTRIBUTES":  7,
}

func (x Permission) String() string {
	return proto.EnumName(Permission_name, int32(x))
}

func (Permission) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{0}
}

// MarketAccount is an account type for use with the accounts module to hold some basic information about a market.
type MarketAccount struct {
	// base_account is the base cosmos account information.
	*types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty"`
	// market_id is the numerical identifier for this market.
	MarketId uint32 `protobuf:"varint,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	// market_details is some human-consumable information about this market.
	MarketDetails MarketDetails `protobuf:"bytes,3,opt,name=market_details,json=marketDetails,proto3" json:"market_details"`
}

func (m *MarketAccount) Reset()      { *m = MarketAccount{} }
func (*MarketAccount) ProtoMessage() {}
func (*MarketAccount) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{0}
}
func (m *MarketAccount) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MarketAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MarketAccount.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 *MarketAccount) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MarketAccount.Merge(m, src)
}
func (m *MarketAccount) XXX_Size() int {
	return m.Size()
}
func (m *MarketAccount) XXX_DiscardUnknown() {
	xxx_messageInfo_MarketAccount.DiscardUnknown(m)
}

var xxx_messageInfo_MarketAccount proto.InternalMessageInfo

// MarketDetails contains information about a market.
type MarketDetails struct {
	// name is a moniker that people can use to refer to this market.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// description extra information about this market. The field is meant to be human-readable.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// website_url is a url people can use to get to this market, or at least get more information about this market.
	WebsiteUrl string `protobuf:"bytes,3,opt,name=website_url,json=websiteUrl,proto3" json:"website_url,omitempty"`
	// icon_uri is a uri for an icon to associate with this market.
	IconUri string `protobuf:"bytes,4,opt,name=icon_uri,json=iconUri,proto3" json:"icon_uri,omitempty"`
}

func (m *MarketDetails) Reset()         { *m = MarketDetails{} }
func (m *MarketDetails) String() string { return proto.CompactTextString(m) }
func (*MarketDetails) ProtoMessage()    {}
func (*MarketDetails) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{1}
}
func (m *MarketDetails) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MarketDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MarketDetails.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 *MarketDetails) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MarketDetails.Merge(m, src)
}
func (m *MarketDetails) XXX_Size() int {
	return m.Size()
}
func (m *MarketDetails) XXX_DiscardUnknown() {
	xxx_messageInfo_MarketDetails.DiscardUnknown(m)
}

var xxx_messageInfo_MarketDetails proto.InternalMessageInfo

func (m *MarketDetails) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *MarketDetails) GetDescription() string {
	if m != nil {
		return m.Description
	}
	return ""
}

func (m *MarketDetails) GetWebsiteUrl() string {
	if m != nil {
		return m.WebsiteUrl
	}
	return ""
}

func (m *MarketDetails) GetIconUri() string {
	if m != nil {
		return m.IconUri
	}
	return ""
}

// MarketBrief is a message containing brief, superficial information about a market.
type MarketBrief struct {
	// market_id is the numerical identifier for this market.
	MarketId uint32 `protobuf:"varint,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	// market_address is the bech32 address string of this market's account.
	MarketAddress string `protobuf:"bytes,2,opt,name=market_address,json=marketAddress,proto3" json:"market_address,omitempty"`
	// market_details is some information about this market.
	MarketDetails MarketDetails `protobuf:"bytes,3,opt,name=market_details,json=marketDetails,proto3" json:"market_details"`
}

func (m *MarketBrief) Reset()         { *m = MarketBrief{} }
func (m *MarketBrief) String() string { return proto.CompactTextString(m) }
func (*MarketBrief) ProtoMessage()    {}
func (*MarketBrief) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{2}
}
func (m *MarketBrief) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *MarketBrief) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MarketBrief.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 *MarketBrief) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MarketBrief.Merge(m, src)
}
func (m *MarketBrief) XXX_Size() int {
	return m.Size()
}
func (m *MarketBrief) XXX_DiscardUnknown() {
	xxx_messageInfo_MarketBrief.DiscardUnknown(m)
}

var xxx_messageInfo_MarketBrief proto.InternalMessageInfo

func (m *MarketBrief) GetMarketId() uint32 {
	if m != nil {
		return m.MarketId
	}
	return 0
}

func (m *MarketBrief) GetMarketAddress() string {
	if m != nil {
		return m.MarketAddress
	}
	return ""
}

func (m *MarketBrief) GetMarketDetails() MarketDetails {
	if m != nil {
		return m.MarketDetails
	}
	return MarketDetails{}
}

// Market contains all information about a market.
type Market struct {
	// market_id is the numerical identifier for this market.
	MarketId uint32 `protobuf:"varint,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	// market_details is some information about this market.
	MarketDetails MarketDetails `protobuf:"bytes,2,opt,name=market_details,json=marketDetails,proto3" json:"market_details"`
	// fee_create_ask_flat is the flat fee charged for creating an ask order.
	// Each coin entry is a separate option. When an ask is created, one of these must be paid.
	// If empty, no fee is required to create an ask order.
	FeeCreateAskFlat []types1.Coin `protobuf:"bytes,3,rep,name=fee_create_ask_flat,json=feeCreateAskFlat,proto3" json:"fee_create_ask_flat"`
	// fee_create_bid_flat is the flat fee charged for creating a bid order.
	// Each coin entry is a separate option. When a bid is created, one of these must be paid.
	// If empty, no fee is required to create a bid order.
	FeeCreateBidFlat []types1.Coin `protobuf:"bytes,4,rep,name=fee_create_bid_flat,json=feeCreateBidFlat,proto3" json:"fee_create_bid_flat"`
	// fee_seller_settlement_flat is the flat fee charged to the seller during settlement.
	// Each coin entry is a separate option.
	// When an ask is settled, the seller will pay the amount in the denom that matches the price they received.
	FeeSellerSettlementFlat []types1.Coin `protobuf:"bytes,5,rep,name=fee_seller_settlement_flat,json=feeSellerSettlementFlat,proto3" json:"fee_seller_settlement_flat"`
	// fee_seller_settlement_ratios is the fee to charge a seller during settlement based on the price they are receiving.
	// The price and fee denoms must be equal for each entry, and only one entry for any given denom is allowed.
	FeeSellerSettlementRatios []FeeRatio `protobuf:"bytes,6,rep,name=fee_seller_settlement_ratios,json=feeSellerSettlementRatios,proto3" json:"fee_seller_settlement_ratios"`
	// fee_buyer_settlement_flat is the flat fee charged to the buyer during settlement.
	// Each coin entry is a separate option.
	// When a bid is created, the settlement fees provided must contain one of these.
	FeeBuyerSettlementFlat []types1.Coin `protobuf:"bytes,7,rep,name=fee_buyer_settlement_flat,json=feeBuyerSettlementFlat,proto3" json:"fee_buyer_settlement_flat"`
	// fee_buyer_settlement_ratios is the fee to charge a buyer during settlement based on the price they are spending.
	// The price and fee denoms do not have to equal. Multiple entries for any given price or fee denom are allowed, but
	// each price denom to fee denom pair can only have one entry.
	FeeBuyerSettlementRatios []FeeRatio `protobuf:"bytes,8,rep,name=fee_buyer_settlement_ratios,json=feeBuyerSettlementRatios,proto3" json:"fee_buyer_settlement_ratios"`
	// accepting_orders is whether this market is allowing orders to be created for it.
	AcceptingOrders bool `protobuf:"varint,9,opt,name=accepting_orders,json=acceptingOrders,proto3" json:"accepting_orders,omitempty"`
	// allow_user_settlement is whether this market allows users to initiate their own settlements.
	// For example, the FillBids and FillAsks endpoints are available if and only if this is true.
	// The MarketSettle endpoint is only available to market actors regardless of the value of this field.
	AllowUserSettlement bool `protobuf:"varint,10,opt,name=allow_user_settlement,json=allowUserSettlement,proto3" json:"allow_user_settlement,omitempty"`
	// access_grants is the list of addresses and permissions granted for this market.
	AccessGrants []AccessGrant `protobuf:"bytes,11,rep,name=access_grants,json=accessGrants,proto3" json:"access_grants"`
	// req_attr_create_ask is a list of attributes required on an account for it to be allowed to create an ask order.
	// An account must have all of these attributes in order to create an ask order in this market.
	// If the list is empty, any account can create ask orders in this market.
	//
	// An entry that starts with "*." will match any attributes that end with the rest of it.
	// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "b.x.a", or "c.b.a.x".
	ReqAttrCreateAsk []string `protobuf:"bytes,12,rep,name=req_attr_create_ask,json=reqAttrCreateAsk,proto3" json:"req_attr_create_ask,omitempty"`
	// req_attr_create_ask is a list of attributes required on an account for it to be allowed to create a bid order.
	// An account must have all of these attributes in order to create a bid order in this market.
	// If the list is empty, any account can create bid orders in this market.
	//
	// An entry that starts with "*." will match any attributes that end with the rest of it.
	// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "c.b.x.a", or "c.b.a.x".
	ReqAttrCreateBid []string `protobuf:"bytes,13,rep,name=req_attr_create_bid,json=reqAttrCreateBid,proto3" json:"req_attr_create_bid,omitempty"`
	// accepting_commitments is whether the market is allowing users to commit funds to it.
	AcceptingCommitments bool `protobuf:"varint,14,opt,name=accepting_commitments,json=acceptingCommitments,proto3" json:"accepting_commitments,omitempty"`
	// fee_create_commitment_flat is the flat fee charged for creating a commitment.
	// Each coin entry is a separate option. When a commitment is created, one of these must be paid.
	// If empty, no fee is required to create a commitment.
	FeeCreateCommitmentFlat []types1.Coin `protobuf:"bytes,15,rep,name=fee_create_commitment_flat,json=feeCreateCommitmentFlat,proto3" json:"fee_create_commitment_flat"`
	// commitment_settlement_bips is the fraction of a commitment settlement that will be paid to the exchange.
	// It is represented in basis points (1/100th of 1%, e.g. 0.0001) and is limited to 0 to 10,000 inclusive.
	// During a commitment settlement, the inputs are summed and NAVs are used to convert that total to the
	// intermediary denom, then to the fee denom. That is then multiplied by this value to get the fee amount
	// that will be transferred out of the market's account into the exchange for that settlement.
	//
	// Summing the inputs effectively doubles the value of the settlement from what what is usually thought of
	// as the value of a trade. That should be taken into account when setting this value.
	// E.g. if two accounts are trading 10apples for 100grapes, the inputs total will be 10apples,100grapes
	// (which might then be converted to USD then nhash before applying this ratio); Usually, though, the value
	// of that trade would be viewed as either just 10apples or just 100grapes.
	CommitmentSettlementBips uint32 `protobuf:"varint,16,opt,name=commitment_settlement_bips,json=commitmentSettlementBips,proto3" json:"commitment_settlement_bips,omitempty"`
	// intermediary_denom is the denom that funds get converted to (before being converted to the chain's fee denom)
	// when calculating the fees that are paid to the exchange. NAVs are used for this conversion and actions will fail
	// if a NAV is needed but not available.
	IntermediaryDenom string `protobuf:"bytes,17,opt,name=intermediary_denom,json=intermediaryDenom,proto3" json:"intermediary_denom,omitempty"`
	// req_attr_create_commitment is a list of attributes required on an account for it to be allowed to create a
	// commitment. An account must have all of these attributes in order to create a commitment in this market.
	// If the list is empty, any account can create commitments in this market.
	//
	// An entry that starts with "*." will match any attributes that end with the rest of it.
	// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "c.b.x.a", or "c.b.a.x".
	ReqAttrCreateCommitment []string `protobuf:"bytes,18,rep,name=req_attr_create_commitment,json=reqAttrCreateCommitment,proto3" json:"req_attr_create_commitment,omitempty"`
}

func (m *Market) Reset()         { *m = Market{} }
func (m *Market) String() string { return proto.CompactTextString(m) }
func (*Market) ProtoMessage()    {}
func (*Market) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{3}
}
func (m *Market) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Market) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Market.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 *Market) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Market.Merge(m, src)
}
func (m *Market) XXX_Size() int {
	return m.Size()
}
func (m *Market) XXX_DiscardUnknown() {
	xxx_messageInfo_Market.DiscardUnknown(m)
}

var xxx_messageInfo_Market proto.InternalMessageInfo

func (m *Market) GetMarketId() uint32 {
	if m != nil {
		return m.MarketId
	}
	return 0
}

func (m *Market) GetMarketDetails() MarketDetails {
	if m != nil {
		return m.MarketDetails
	}
	return MarketDetails{}
}

func (m *Market) GetFeeCreateAskFlat() []types1.Coin {
	if m != nil {
		return m.FeeCreateAskFlat
	}
	return nil
}

func (m *Market) GetFeeCreateBidFlat() []types1.Coin {
	if m != nil {
		return m.FeeCreateBidFlat
	}
	return nil
}

func (m *Market) GetFeeSellerSettlementFlat() []types1.Coin {
	if m != nil {
		return m.FeeSellerSettlementFlat
	}
	return nil
}

func (m *Market) GetFeeSellerSettlementRatios() []FeeRatio {
	if m != nil {
		return m.FeeSellerSettlementRatios
	}
	return nil
}

func (m *Market) GetFeeBuyerSettlementFlat() []types1.Coin {
	if m != nil {
		return m.FeeBuyerSettlementFlat
	}
	return nil
}

func (m *Market) GetFeeBuyerSettlementRatios() []FeeRatio {
	if m != nil {
		return m.FeeBuyerSettlementRatios
	}
	return nil
}

func (m *Market) GetAcceptingOrders() bool {
	if m != nil {
		return m.AcceptingOrders
	}
	return false
}

func (m *Market) GetAllowUserSettlement() bool {
	if m != nil {
		return m.AllowUserSettlement
	}
	return false
}

func (m *Market) GetAccessGrants() []AccessGrant {
	if m != nil {
		return m.AccessGrants
	}
	return nil
}

func (m *Market) GetReqAttrCreateAsk() []string {
	if m != nil {
		return m.ReqAttrCreateAsk
	}
	return nil
}

func (m *Market) GetReqAttrCreateBid() []string {
	if m != nil {
		return m.ReqAttrCreateBid
	}
	return nil
}

func (m *Market) GetAcceptingCommitments() bool {
	if m != nil {
		return m.AcceptingCommitments
	}
	return false
}

func (m *Market) GetFeeCreateCommitmentFlat() []types1.Coin {
	if m != nil {
		return m.FeeCreateCommitmentFlat
	}
	return nil
}

func (m *Market) GetCommitmentSettlementBips() uint32 {
	if m != nil {
		return m.CommitmentSettlementBips
	}
	return 0
}

func (m *Market) GetIntermediaryDenom() string {
	if m != nil {
		return m.IntermediaryDenom
	}
	return ""
}

func (m *Market) GetReqAttrCreateCommitment() []string {
	if m != nil {
		return m.ReqAttrCreateCommitment
	}
	return nil
}

// FeeRatio defines a ratio of price amount to fee amount.
// For an order to be valid, its price must be evenly divisible by a FeeRatio's price.
type FeeRatio struct {
	// price is the unit the order price is divided by to get how much of the fee should apply.
	Price types1.Coin `protobuf:"bytes,1,opt,name=price,proto3" json:"price"`
	// fee is the amount to charge per price unit.
	Fee types1.Coin `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee"`
}

func (m *FeeRatio) Reset()      { *m = FeeRatio{} }
func (*FeeRatio) ProtoMessage() {}
func (*FeeRatio) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{4}
}
func (m *FeeRatio) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *FeeRatio) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_FeeRatio.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 *FeeRatio) XXX_Merge(src proto.Message) {
	xxx_messageInfo_FeeRatio.Merge(m, src)
}
func (m *FeeRatio) XXX_Size() int {
	return m.Size()
}
func (m *FeeRatio) XXX_DiscardUnknown() {
	xxx_messageInfo_FeeRatio.DiscardUnknown(m)
}

var xxx_messageInfo_FeeRatio proto.InternalMessageInfo

func (m *FeeRatio) GetPrice() types1.Coin {
	if m != nil {
		return m.Price
	}
	return types1.Coin{}
}

func (m *FeeRatio) GetFee() types1.Coin {
	if m != nil {
		return m.Fee
	}
	return types1.Coin{}
}

// AddrPermissions associates an address with a list of permissions available for that address.
type AccessGrant struct {
	// address is the address that these permissions apply to.
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// allowed is the list of permissions available for the address.
	Permissions []Permission `protobuf:"varint,2,rep,packed,name=permissions,proto3,enum=provenance.exchange.v1.Permission" json:"permissions,omitempty"`
}

func (m *AccessGrant) Reset()         { *m = AccessGrant{} }
func (m *AccessGrant) String() string { return proto.CompactTextString(m) }
func (*AccessGrant) ProtoMessage()    {}
func (*AccessGrant) Descriptor() ([]byte, []int) {
	return fileDescriptor_d5cf198f1dd7e167, []int{5}
}
func (m *AccessGrant) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *AccessGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_AccessGrant.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 *AccessGrant) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AccessGrant.Merge(m, src)
}
func (m *AccessGrant) XXX_Size() int {
	return m.Size()
}
func (m *AccessGrant) XXX_DiscardUnknown() {
	xxx_messageInfo_AccessGrant.DiscardUnknown(m)
}

var xxx_messageInfo_AccessGrant proto.InternalMessageInfo

func (m *AccessGrant) GetAddress() string {
	if m != nil {
		return m.Address
	}
	return ""
}

func (m *AccessGrant) GetPermissions() []Permission {
	if m != nil {
		return m.Permissions
	}
	return nil
}

func init() {
	proto.RegisterEnum("provenance.exchange.v1.Permission", Permission_name, Permission_value)
	proto.RegisterType((*MarketAccount)(nil), "provenance.exchange.v1.MarketAccount")
	proto.RegisterType((*MarketDetails)(nil), "provenance.exchange.v1.MarketDetails")
	proto.RegisterType((*MarketBrief)(nil), "provenance.exchange.v1.MarketBrief")
	proto.RegisterType((*Market)(nil), "provenance.exchange.v1.Market")
	proto.RegisterType((*FeeRatio)(nil), "provenance.exchange.v1.FeeRatio")
	proto.RegisterType((*AccessGrant)(nil), "provenance.exchange.v1.AccessGrant")
}

func init() {
	proto.RegisterFile("provenance/exchange/v1/market.proto", fileDescriptor_d5cf198f1dd7e167)
}

var fileDescriptor_d5cf198f1dd7e167 = []byte{
	// 1127 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6b, 0x1b, 0xc7,
	0x1b, 0xd6, 0x5a, 0x8a, 0x2d, 0x8d, 0x6c, 0x67, 0x33, 0xfe, 0x93, 0xb5, 0xf2, 0x43, 0xda, 0x9f,
	0x4c, 0x40, 0x69, 0xb1, 0x84, 0x1d, 0x7a, 0x71, 0x0b, 0x45, 0xff, 0xdc, 0x0a, 0x12, 0xc7, 0xac,
	0x24, 0x02, 0xa1, 0xb0, 0x8c, 0x76, 0x5f, 0xc9, 0x83, 0xa5, 0x5d, 0x65, 0x66, 0x64, 0x27, 0xfd,
	0x02, 0x2d, 0x3e, 0xf5, 0xd8, 0x8b, 0xc1, 0x1f, 0xa2, 0xf7, 0xde, 0x4a, 0x8e, 0xa6, 0x50, 0xe8,
	0x29, 0x14, 0xfb, 0xd2, 0x4b, 0xbf, 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, 0x68, 0x33, 0x72, 0x32, 0xa5, 0xd4, 0x3e, 0xa8, 0x95, 0x5b, 0x75,
	0xf5, 0x9e, 0xaf, 0x34, 0x1a, 0xda, 0x44, 0xc0, 0x94, 0xc3, 0xf0, 0xb3, 0xa9, 0xce, 0xfb, 0x0e,
	0x23, 0xdd, 0xc1, 0x4f, 0xd0, 0x5a, 0x84, 0x5c, 0x6e, 0xb5, 0x8c, 0x46, 0xa5, 0xdd, 0xaa, 0x37,
	0xd5, 0x85, 0xcc, 0xf2, 0xe9, 0x99, 0x8e, 0xbc, 0xc9, 0xa3, 0x9d, 0x91, 0x00, 0x5e, 0x81, 0x77,
	0x97, 0x59, 0xe5, 0xe2, 0x32, 0xab, 0xfc, 0x71, 0x99, 0x55, 0x7e, 0xb8, 0xca, 0xc6, 0x2e, 0xae,
	0xb2, 0xb1, 0xdf, 0xaf, 0xb2, 0x31, 0xb4, 0x41, 0xdd, 0x1b, 0x4e, 0xe5, 0x40, 0x79, 0x55, 0xec,
	0x51, 0x71, 0x38, 0xea, 0x14, 0x2d, 0x77, 0x50, 0x0a, 0x49, 0x5b, 0xd4, 0x8d, 0xac, 0x4a, 0x6f,
	0x26, 0xbf, 0x98, 0x9d, 0x79, 0xf9, 0x43, 0xf7, 0xf4, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd5,
	0x10, 0x90, 0x0d, 0x80, 0x0a, 0x00, 0x00,
}

func (this *MarketDetails) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*MarketDetails)
	if !ok {
		that2, ok := that.(MarketDetails)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if this.Name != that1.Name {
		return false
	}
	if this.Description != that1.Description {
		return false
	}
	if this.WebsiteUrl != that1.WebsiteUrl {
		return false
	}
	if this.IconUri != that1.IconUri {
		return false
	}
	return true
}
func (m *MarketAccount) 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 *MarketAccount) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MarketAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.MarketDetails.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintMarket(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x1a
	if m.MarketId != 0 {
		i = encodeVarintMarket(dAtA, i, uint64(m.MarketId))
		i--
		dAtA[i] = 0x10
	}
	if m.BaseAccount != nil {
		{
			size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintMarket(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *MarketDetails) 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 *MarketDetails) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MarketDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.IconUri) > 0 {
		i -= len(m.IconUri)
		copy(dAtA[i:], m.IconUri)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.IconUri)))
		i--
		dAtA[i] = 0x22
	}
	if len(m.WebsiteUrl) > 0 {
		i -= len(m.WebsiteUrl)
		copy(dAtA[i:], m.WebsiteUrl)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.WebsiteUrl)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Description) > 0 {
		i -= len(m.Description)
		copy(dAtA[i:], m.Description)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.Description)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.Name) > 0 {
		i -= len(m.Name)
		copy(dAtA[i:], m.Name)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.Name)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *MarketBrief) 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 *MarketBrief) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *MarketBrief) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.MarketDetails.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintMarket(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x1a
	if len(m.MarketAddress) > 0 {
		i -= len(m.MarketAddress)
		copy(dAtA[i:], m.MarketAddress)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.MarketAddress)))
		i--
		dAtA[i] = 0x12
	}
	if m.MarketId != 0 {
		i = encodeVarintMarket(dAtA, i, uint64(m.MarketId))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func (m *Market) 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 *Market) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Market) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.ReqAttrCreateCommitment) > 0 {
		for iNdEx := len(m.ReqAttrCreateCommitment) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.ReqAttrCreateCommitment[iNdEx])
			copy(dAtA[i:], m.ReqAttrCreateCommitment[iNdEx])
			i = encodeVarintMarket(dAtA, i, uint64(len(m.ReqAttrCreateCommitment[iNdEx])))
			i--
			dAtA[i] = 0x1
			i--
			dAtA[i] = 0x92
		}
	}
	if len(m.IntermediaryDenom) > 0 {
		i -= len(m.IntermediaryDenom)
		copy(dAtA[i:], m.IntermediaryDenom)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.IntermediaryDenom)))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x8a
	}
	if m.CommitmentSettlementBips != 0 {
		i = encodeVarintMarket(dAtA, i, uint64(m.CommitmentSettlementBips))
		i--
		dAtA[i] = 0x1
		i--
		dAtA[i] = 0x80
	}
	if len(m.FeeCreateCommitmentFlat) > 0 {
		for iNdEx := len(m.FeeCreateCommitmentFlat) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeCreateCommitmentFlat[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x7a
		}
	}
	if m.AcceptingCommitments {
		i--
		if m.AcceptingCommitments {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x70
	}
	if len(m.ReqAttrCreateBid) > 0 {
		for iNdEx := len(m.ReqAttrCreateBid) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.ReqAttrCreateBid[iNdEx])
			copy(dAtA[i:], m.ReqAttrCreateBid[iNdEx])
			i = encodeVarintMarket(dAtA, i, uint64(len(m.ReqAttrCreateBid[iNdEx])))
			i--
			dAtA[i] = 0x6a
		}
	}
	if len(m.ReqAttrCreateAsk) > 0 {
		for iNdEx := len(m.ReqAttrCreateAsk) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.ReqAttrCreateAsk[iNdEx])
			copy(dAtA[i:], m.ReqAttrCreateAsk[iNdEx])
			i = encodeVarintMarket(dAtA, i, uint64(len(m.ReqAttrCreateAsk[iNdEx])))
			i--
			dAtA[i] = 0x62
		}
	}
	if len(m.AccessGrants) > 0 {
		for iNdEx := len(m.AccessGrants) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.AccessGrants[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x5a
		}
	}
	if m.AllowUserSettlement {
		i--
		if m.AllowUserSettlement {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x50
	}
	if m.AcceptingOrders {
		i--
		if m.AcceptingOrders {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x48
	}
	if len(m.FeeBuyerSettlementRatios) > 0 {
		for iNdEx := len(m.FeeBuyerSettlementRatios) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeBuyerSettlementRatios[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x42
		}
	}
	if len(m.FeeBuyerSettlementFlat) > 0 {
		for iNdEx := len(m.FeeBuyerSettlementFlat) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeBuyerSettlementFlat[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x3a
		}
	}
	if len(m.FeeSellerSettlementRatios) > 0 {
		for iNdEx := len(m.FeeSellerSettlementRatios) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeSellerSettlementRatios[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x32
		}
	}
	if len(m.FeeSellerSettlementFlat) > 0 {
		for iNdEx := len(m.FeeSellerSettlementFlat) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeSellerSettlementFlat[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x2a
		}
	}
	if len(m.FeeCreateBidFlat) > 0 {
		for iNdEx := len(m.FeeCreateBidFlat) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeCreateBidFlat[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x22
		}
	}
	if len(m.FeeCreateAskFlat) > 0 {
		for iNdEx := len(m.FeeCreateAskFlat) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.FeeCreateAskFlat[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintMarket(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x1a
		}
	}
	{
		size, err := m.MarketDetails.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintMarket(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x12
	if m.MarketId != 0 {
		i = encodeVarintMarket(dAtA, i, uint64(m.MarketId))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func (m *FeeRatio) 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 *FeeRatio) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *FeeRatio) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintMarket(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x12
	{
		size, err := m.Price.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintMarket(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

func (m *AccessGrant) 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 *AccessGrant) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *AccessGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Permissions) > 0 {
		dAtA8 := make([]byte, len(m.Permissions)*10)
		var j7 int
		for _, num := range m.Permissions {
			for num >= 1<<7 {
				dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80)
				num >>= 7
				j7++
			}
			dAtA8[j7] = uint8(num)
			j7++
		}
		i -= j7
		copy(dAtA[i:], dAtA8[:j7])
		i = encodeVarintMarket(dAtA, i, uint64(j7))
		i--
		dAtA[i] = 0x12
	}
	if len(m.Address) > 0 {
		i -= len(m.Address)
		copy(dAtA[i:], m.Address)
		i = encodeVarintMarket(dAtA, i, uint64(len(m.Address)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintMarket(dAtA []byte, offset int, v uint64) int {
	offset -= sovMarket(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *MarketAccount) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.BaseAccount != nil {
		l = m.BaseAccount.Size()
		n += 1 + l + sovMarket(uint64(l))
	}
	if m.MarketId != 0 {
		n += 1 + sovMarket(uint64(m.MarketId))
	}
	l = m.MarketDetails.Size()
	n += 1 + l + sovMarket(uint64(l))
	return n
}

func (m *MarketDetails) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Name)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	l = len(m.Description)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	l = len(m.WebsiteUrl)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	l = len(m.IconUri)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	return n
}

func (m *MarketBrief) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.MarketId != 0 {
		n += 1 + sovMarket(uint64(m.MarketId))
	}
	l = len(m.MarketAddress)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	l = m.MarketDetails.Size()
	n += 1 + l + sovMarket(uint64(l))
	return n
}

func (m *Market) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.MarketId != 0 {
		n += 1 + sovMarket(uint64(m.MarketId))
	}
	l = m.MarketDetails.Size()
	n += 1 + l + sovMarket(uint64(l))
	if len(m.FeeCreateAskFlat) > 0 {
		for _, e := range m.FeeCreateAskFlat {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.FeeCreateBidFlat) > 0 {
		for _, e := range m.FeeCreateBidFlat {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.FeeSellerSettlementFlat) > 0 {
		for _, e := range m.FeeSellerSettlementFlat {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.FeeSellerSettlementRatios) > 0 {
		for _, e := range m.FeeSellerSettlementRatios {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.FeeBuyerSettlementFlat) > 0 {
		for _, e := range m.FeeBuyerSettlementFlat {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.FeeBuyerSettlementRatios) > 0 {
		for _, e := range m.FeeBuyerSettlementRatios {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if m.AcceptingOrders {
		n += 2
	}
	if m.AllowUserSettlement {
		n += 2
	}
	if len(m.AccessGrants) > 0 {
		for _, e := range m.AccessGrants {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.ReqAttrCreateAsk) > 0 {
		for _, s := range m.ReqAttrCreateAsk {
			l = len(s)
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if len(m.ReqAttrCreateBid) > 0 {
		for _, s := range m.ReqAttrCreateBid {
			l = len(s)
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if m.AcceptingCommitments {
		n += 2
	}
	if len(m.FeeCreateCommitmentFlat) > 0 {
		for _, e := range m.FeeCreateCommitmentFlat {
			l = e.Size()
			n += 1 + l + sovMarket(uint64(l))
		}
	}
	if m.CommitmentSettlementBips != 0 {
		n += 2 + sovMarket(uint64(m.CommitmentSettlementBips))
	}
	l = len(m.IntermediaryDenom)
	if l > 0 {
		n += 2 + l + sovMarket(uint64(l))
	}
	if len(m.ReqAttrCreateCommitment) > 0 {
		for _, s := range m.ReqAttrCreateCommitment {
			l = len(s)
			n += 2 + l + sovMarket(uint64(l))
		}
	}
	return n
}

func (m *FeeRatio) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = m.Price.Size()
	n += 1 + l + sovMarket(uint64(l))
	l = m.Fee.Size()
	n += 1 + l + sovMarket(uint64(l))
	return n
}

func (m *AccessGrant) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Address)
	if l > 0 {
		n += 1 + l + sovMarket(uint64(l))
	}
	if len(m.Permissions) > 0 {
		l = 0
		for _, e := range m.Permissions {
			l += sovMarket(uint64(e))
		}
		n += 1 + sovMarket(uint64(l)) + l
	}
	return n
}

func sovMarket(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozMarket(x uint64) (n int) {
	return sovMarket(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *MarketAccount) 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 ErrIntOverflowMarket
			}
			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: MarketAccount: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MarketAccount: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.BaseAccount == nil {
				m.BaseAccount = &types.BaseAccount{}
			}
			if err := m.BaseAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType)
			}
			m.MarketId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.MarketId |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketDetails", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.MarketDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *MarketDetails) 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 ErrIntOverflowMarket
			}
			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: MarketDetails: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MarketDetails: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Name = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			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 WebsiteUrl", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.WebsiteUrl = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field IconUri", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.IconUri = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *MarketBrief) 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 ErrIntOverflowMarket
			}
			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: MarketBrief: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: MarketBrief: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType)
			}
			m.MarketId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.MarketId |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.MarketAddress = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketDetails", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.MarketDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *Market) 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 ErrIntOverflowMarket
			}
			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: Market: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Market: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType)
			}
			m.MarketId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.MarketId |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MarketDetails", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.MarketDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeCreateAskFlat", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeCreateAskFlat = append(m.FeeCreateAskFlat, types1.Coin{})
			if err := m.FeeCreateAskFlat[len(m.FeeCreateAskFlat)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeCreateBidFlat", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeCreateBidFlat = append(m.FeeCreateBidFlat, types1.Coin{})
			if err := m.FeeCreateBidFlat[len(m.FeeCreateBidFlat)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 5:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeSellerSettlementFlat", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeSellerSettlementFlat = append(m.FeeSellerSettlementFlat, types1.Coin{})
			if err := m.FeeSellerSettlementFlat[len(m.FeeSellerSettlementFlat)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 6:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeSellerSettlementRatios", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeSellerSettlementRatios = append(m.FeeSellerSettlementRatios, FeeRatio{})
			if err := m.FeeSellerSettlementRatios[len(m.FeeSellerSettlementRatios)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 7:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeBuyerSettlementFlat", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeBuyerSettlementFlat = append(m.FeeBuyerSettlementFlat, types1.Coin{})
			if err := m.FeeBuyerSettlementFlat[len(m.FeeBuyerSettlementFlat)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeBuyerSettlementRatios", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeBuyerSettlementRatios = append(m.FeeBuyerSettlementRatios, FeeRatio{})
			if err := m.FeeBuyerSettlementRatios[len(m.FeeBuyerSettlementRatios)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 9:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field AcceptingOrders", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.AcceptingOrders = bool(v != 0)
		case 10:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field AllowUserSettlement", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.AllowUserSettlement = bool(v != 0)
		case 11:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field AccessGrants", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.AccessGrants = append(m.AccessGrants, AccessGrant{})
			if err := m.AccessGrants[len(m.AccessGrants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 12:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ReqAttrCreateAsk", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ReqAttrCreateAsk = append(m.ReqAttrCreateAsk, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 13:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ReqAttrCreateBid", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ReqAttrCreateBid = append(m.ReqAttrCreateBid, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 14:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field AcceptingCommitments", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.AcceptingCommitments = bool(v != 0)
		case 15:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FeeCreateCommitmentFlat", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FeeCreateCommitmentFlat = append(m.FeeCreateCommitmentFlat, types1.Coin{})
			if err := m.FeeCreateCommitmentFlat[len(m.FeeCreateCommitmentFlat)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 16:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field CommitmentSettlementBips", wireType)
			}
			m.CommitmentSettlementBips = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.CommitmentSettlementBips |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 17:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field IntermediaryDenom", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.IntermediaryDenom = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 18:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ReqAttrCreateCommitment", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ReqAttrCreateCommitment = append(m.ReqAttrCreateCommitment, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *FeeRatio) 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 ErrIntOverflowMarket
			}
			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: FeeRatio: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: FeeRatio: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthMarket
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *AccessGrant) 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 ErrIntOverflowMarket
			}
			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: AccessGrant: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AccessGrant: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowMarket
				}
				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 ErrInvalidLengthMarket
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthMarket
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Address = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType == 0 {
				var v Permission
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return ErrIntOverflowMarket
					}
					if iNdEx >= l {
						return io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					v |= Permission(b&0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				m.Permissions = append(m.Permissions, v)
			} else if wireType == 2 {
				var packedLen int
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return ErrIntOverflowMarket
					}
					if iNdEx >= l {
						return io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					packedLen |= int(b&0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				if packedLen < 0 {
					return ErrInvalidLengthMarket
				}
				postIndex := iNdEx + packedLen
				if postIndex < 0 {
					return ErrInvalidLengthMarket
				}
				if postIndex > l {
					return io.ErrUnexpectedEOF
				}
				var elementCount int
				if elementCount != 0 && len(m.Permissions) == 0 {
					m.Permissions = make([]Permission, 0, elementCount)
				}
				for iNdEx < postIndex {
					var v Permission
					for shift := uint(0); ; shift += 7 {
						if shift >= 64 {
							return ErrIntOverflowMarket
						}
						if iNdEx >= l {
							return io.ErrUnexpectedEOF
						}
						b := dAtA[iNdEx]
						iNdEx++
						v |= Permission(b&0x7F) << shift
						if b < 0x80 {
							break
						}
					}
					m.Permissions = append(m.Permissions, v)
				}
			} else {
				return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
			}
		default:
			iNdEx = preIndex
			skippy, err := skipMarket(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthMarket
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipMarket(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, ErrIntOverflowMarket
			}
			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, ErrIntOverflowMarket
				}
				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, ErrIntOverflowMarket
				}
				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, ErrInvalidLengthMarket
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupMarket
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthMarket
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthMarket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMarket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMarket = fmt.Errorf("proto: unexpected end of group")
)
