types

package
v0.0.0-...-6e12e82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ErrTextInvalidParamType                                  = "invalid parameter type"
	ErrTextBatchSettlementCountMustBePositive                = "batch settlement count should be a positive number"
	ErrTextInitGenesisFailedBecauseOfMissingBetID            = "no bet id found for the bet with uuid"
	ErrTextInitGenesisFailedBecauseOfNotEqualStats           = "bet list items count is not equal to stats count"
	ErrTextInitGenesisFailedBetCountNotEqualActiveAndSettled = "sum of active and settled list items count is not equal to bet list items count"
	ErrTextInitGenesisFailedNotActiveOrSettled               = "bet is not active nor settled with uuid"
	ErrTextInitGenesisFailedSettlementHeightIsZero           = "settlement height can not be zero for the settled bet with uuid"
	ErrTextInitGenesisFailedSettlementHeightIsZeroForList    = "settlement height can not be zero for a bet in the settled bet list with uuid"
	ErrTextInitGenesisFailedSettlementHeightIsNotZero        = "settlement height should be zero for the active bet with uuid"
)

x/bet module sentinel error text

View Source
const (
	// AttributeKeyBetCreator is the market attribute for bet creator
	AttributeKeyBetCreator = "bet_creator"

	// AttributeKeyBetUID is the market attribute for bet unique identifier
	AttributeKeyBetUID = "bet_uid"

	// AttributeKeyMarketUID is the market attribute for market unique identifier
	AttributeKeyMarketUID = "market_uid"

	// AttributeValueCategory is the market attribute for category as module name
	AttributeValueCategory = ModuleName
)

bet module market data

View Source
const (
	// ModuleName defines the module name
	ModuleName = "bet"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_bet"
)
View Source
const (
	// TypeMsgPlaceBet is type of message MsgPlaceBet
	TypeMsgPlaceBet = "place_bet"
	// SettlementUIDsThreshold is the threshold for the number of UIDs in bulk settlement tx
	SettlementUIDsThreshold = 10
	// BetPlacementThreshold is the threshold for the number bets in bulk placement tx
	BetPlacementThreshold = 10
)
View Source
const DefaultUID uint64 = 1

DefaultUID is the default global uid

View Source
const (

	// MaxAllowedQueryBetsCount is maximum allowed count of bets that can be filtered by uid list
	MaxAllowedQueryBetsCount = 10
)

Variables

View Source
var (
	ErrInvalidLengthBet        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBet          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBet = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthBetOdds        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBetOdds          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBetOdds = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// Amino is the legacy aminto codec
	Amino = codec.NewLegacyAmino()
	// ModuleCdc is the codec of the module
	ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)
View Source
var (
	ErrInTicketVerification                 = sdkerrors.Register(ModuleName, 2001, "ticket verification failed")
	ErrInTicketValidation                   = sdkerrors.Register(ModuleName, 2002, "ticket validation failed")
	ErrInBetPlacement                       = sdkerrors.Register(ModuleName, 2003, "bet placement failed")
	ErrInvalidBetUID                        = sdkerrors.Register(ModuleName, 2004, "invalid Bet Uid")
	ErrBetIsCanceled                        = sdkerrors.Register(ModuleName, 2005, "bet is already canceled")
	ErrBetIsSettled                         = sdkerrors.Register(ModuleName, 2006, "bet is already settled")
	ErrInSRBettorLoses                      = sdkerrors.Register(ModuleName, 2007, "internal error in processing better loss in SR")
	ErrInSRBettorWins                       = sdkerrors.Register(ModuleName, 2008, "internal error in processing better win in SR")
	ErrNoMatchingMarket                     = sdkerrors.Register(ModuleName, 2009, "market not found")
	ErrInvalidOddsUID                       = sdkerrors.Register(ModuleName, 2010, "invalid odds UID")
	ErrEmptyOddsValue                       = sdkerrors.Register(ModuleName, 2011, "odds value should not be empty")
	ErrInvalidMarketUID                     = sdkerrors.Register(ModuleName, 2012, "invalid market UID")
	ErrInvalidTicket                        = sdkerrors.Register(ModuleName, 2013, "invalid ticket")
	ErrInvalidAmount                        = sdkerrors.Register(ModuleName, 2014, "invalid amount")
	ErrNoMatchingBet                        = sdkerrors.Register(ModuleName, 2015, "bet not found")
	ErrResultNotDeclared                    = sdkerrors.Register(ModuleName, 2016, "market result is not declared")
	ErrDuplicateUID                         = sdkerrors.Register(ModuleName, 2017, "UID is already set")
	ErrInSRPlacementProcessing              = sdkerrors.Register(ModuleName, 2018, "internal error in processing bet placement in SR")
	ErrEndTSIsPassed                        = sdkerrors.Register(ModuleName, 2019, "market is expired")
	ErrOddsUIDNotExist                      = sdkerrors.Register(ModuleName, 2020, "market does not have this odds UID")
	ErrInSRRefund                           = sdkerrors.Register(ModuleName, 2021, "internal error in refunding user in SR")
	ErrInactiveMarket                       = sdkerrors.Register(ModuleName, 2022, "market is not active")
	ErrBetAmountIsLow                       = sdkerrors.Register(ModuleName, 2023, "bet amount is lower than the minimum allowed")
	ErrInConvertingOddsToDec                = sdkerrors.Register(ModuleName, 2024, "internal error in converting odds value from string to sdk.Dec")
	ErrInConvertingOddsToInt                = sdkerrors.Register(ModuleName, 2025, "internal error in converting odds value from string to sdk.Int")
	ErrOddsDataNotFound                     = sdkerrors.Register(ModuleName, 2026, "odds does not exist in ticket payload")
	ErrInvalidOddsType                      = sdkerrors.Register(ModuleName, 2027, "valid odds type should be provided, 1: decimal, 2: fractional, 3: moneyline")
	ErrUserKycFailed                        = sdkerrors.Register(ModuleName, 2028, "the bettor failed the KYC Validation")
	ErrCanNotQueryLargeNumberOfBets         = sdkerrors.Register(ModuleName, 2029, "can not query more than "+cast.ToString(MaxAllowedQueryBetsCount))
	ErrDecimalOddsShouldBePositive          = sdkerrors.Register(ModuleName, 2030, "decimal odds value should be positive")
	ErrDecimalOddsCanNotBeLessThanOne       = sdkerrors.Register(ModuleName, 2031, "decimal odds value can not less than or equal to 1")
	ErrFractionalOddsCanNotBeNegativeOrZero = sdkerrors.Register(ModuleName, 2032, "fractional odds numbers can not be negative")
	ErrMoneylineOddsCanNotBeZero            = sdkerrors.Register(ModuleName, 2033, "moneyline odds can not be zero")
	ErrFractionalOddsIncorrectFormat        = sdkerrors.Register(ModuleName, 2034, "incorrect format of fractional odds")
	ErrBettorAddressNotEqualToCreator       = sdkerrors.Register(ModuleName, 2035, "provided bettor address is not equal to bet owner")
	ErrMaxLossMultiplierCanNotBeZero        = sdkerrors.Register(ModuleName, 2036, "max loss multiplier cannot be nil or zero")
	ErrMaxLossMultiplierCanNotBeMoreThanOne = sdkerrors.Register(ModuleName, 2037, "max loss multiplier cannot be more than one")
)

x/bet module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// BetListPrefix is the prefix to retrieve all Bet
	BetListPrefix = []byte{0x00}
	// BetIDListPrefix is the prefix to retrieve all Bet IDs
	BetIDListPrefix = []byte{0x01}
	// BetStatsKey is the key for the bet statistics
	BetStatsKey = []byte{0x02}
	// PendingBetListPrefix is the prefix to retrieve all pending bets
	PendingBetListPrefix = []byte{0x03}
	// SettledBetListPrefix is the prefix to retrieve all settled bets
	SettledBetListPrefix = []byte{0x04}
)
View Source
var (
	ErrInvalidLengthKyc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowKyc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupKyc = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPlaceBetFields        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPlaceBetFields          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPlaceBetFields = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthStats        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStats          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTicket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTicket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTicket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Bet_Result_name = map[int32]string{
	0: "RESULT_UNSPECIFIED",
	1: "RESULT_PENDING",
	2: "RESULT_WON",
	3: "RESULT_LOST",
	4: "RESULT_REFUNDED",
}
View Source
var Bet_Result_value = map[string]int32{
	"RESULT_UNSPECIFIED": 0,
	"RESULT_PENDING":     1,
	"RESULT_WON":         2,
	"RESULT_LOST":        3,
	"RESULT_REFUNDED":    4,
}
View Source
var Bet_Status_name = map[int32]string{
	0: "STATUS_UNSPECIFIED",
	1: "STATUS_PLACED",
	2: "STATUS_CANCELED",
	3: "STATUS_ABORTED",
	4: "STATUS_PENDING",
	5: "STATUS_RESULT_DECLARED",
	6: "STATUS_SETTLED",
}
View Source
var Bet_Status_value = map[string]int32{
	"STATUS_UNSPECIFIED":     0,
	"STATUS_PLACED":          1,
	"STATUS_CANCELED":        2,
	"STATUS_ABORTED":         3,
	"STATUS_PENDING":         4,
	"STATUS_RESULT_DECLARED": 5,
	"STATUS_SETTLED":         6,
}
View Source
var (
	// KeyBatchSettlementCount is the batch settlement
	// count of bets
	KeyBatchSettlementCount = []byte("BatchSettlementCount")
)

parameter store keys

View Source
var OddsType_name = map[int32]string{
	0: "ODDS_TYPE_UNSPECIFIED",
	1: "ODDS_TYPE_DECIMAL",
	2: "ODDS_TYPE_FRACTIONAL",
	3: "ODDS_TYPE_MONEYLINE",
}
View Source
var OddsType_value = map[string]int32{
	"ODDS_TYPE_UNSPECIFIED": 0,
	"ODDS_TYPE_DECIMAL":     1,
	"ODDS_TYPE_FRACTIONAL":  2,
	"ODDS_TYPE_MONEYLINE":   3,
}

Functions

func BetFieldsValidation

func BetFieldsValidation(bet *PlaceBetFields) error

BetFieldsValidation validates fields of the given bet

func BetIDKey

func BetIDKey(creator string, id uint64) []byte

BetIDKey returns key of a certain bet of a creator.

func BetListByCreatorPrefix

func BetListByCreatorPrefix(creator string) []byte

BetListByCreatorPrefix returns prefix of the certain creator bet list.

func CalculateBetAmount

func CalculateBetAmount(oddsType OddsType, oddsVal string, payoutProfit sdk.Dec) (sdk.Dec, error)

CalculateBetAmount calculates the amount of bet according to bet odds value and payout profit

func CalculatePayoutProfit

func CalculatePayoutProfit(oddsType OddsType, oddsVal string, amount sdk.Int) (sdk.Dec, error)

CalculatePayoutProfit calculates the amount of payout profit portion according to bet odds value and amount

func IsValidUID

func IsValidUID(uid string) bool

IsValidUID validates the uid

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func PendingBetListOfMarketPrefix

func PendingBetListOfMarketPrefix(marketID string) []byte

PendingBetListOfMarketPrefix returns prefix of the certain market pending bet list.

func PendingBetOfMarketKey

func PendingBetOfMarketKey(marketID string, id uint64) []byte

PendingBetOfMarketKey return the key of a certain pending bet of a market.

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

RegisterCodec registers module codec to the app codec

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module interface types

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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 RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func SettledBetListOfBlockHeightPrefix

func SettledBetListOfBlockHeightPrefix(blockHeight int64) []byte

SettledBetListOfBlockHeightPrefix returns prefix of settled bet list on a certain block height.

func SettledBetOfMarketKey

func SettledBetOfMarketKey(blockHeight int64, id uint64) []byte

SettledBetOfMarketKey return the key of settled bet list on a certain block height.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type Bet

type Bet struct {
	// uid is the universal unique identifier assigned to a bet.
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// market_uid is the universal unique identifier of
	// the market on which the bet is placed.
	MarketUID string `protobuf:"bytes,2,opt,name=market_uid,proto3" json:"market_uid"`
	// odds_uid is the universal unique identifier,
	// of the odds on which the bet is placed.
	OddsUID string `protobuf:"bytes,3,opt,name=odds_uid,proto3" json:"odds_uid"`
	// odds_type is the type of odds that
	// user choose such as decimal, fractional, etc
	OddsType OddsType `protobuf:"varint,4,opt,name=odds_type,json=oddsType,proto3,enum=furynetwork.fury.bet.OddsType" json:"odds_type,omitempty"`
	// odds_value is the odds on which the bet is placed.
	OddsValue string `protobuf:"bytes,5,opt,name=odds_value,json=oddsValue,proto3" json:"odds_value,omitempty"`
	// amount is the wager amount.
	Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
	// bet_fee is the betting fee user needs to pay for placing a bet
	BetFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=bet_fee,json=betFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bet_fee"`
	// status is the status of the bet, such as `unspecified` or `settled`.
	Status Bet_Status `protobuf:"varint,8,opt,name=status,proto3,enum=furynetwork.fury.bet.Bet_Status" json:"status,omitempty"`
	// result is the result of the bet, such as `won` or `lost`.
	Result Bet_Result `protobuf:"varint,9,opt,name=result,proto3,enum=furynetwork.fury.bet.Bet_Result" json:"result,omitempty"`
	// creator is the bettor address.
	Creator string `protobuf:"bytes,10,opt,name=creator,proto3" json:"creator,omitempty"`
	// created_at is the bet placement timestamp.
	CreatedAt int64 `protobuf:"varint,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// settlement_height is the block height at which the bet is settled.
	SettlementHeight int64 `protobuf:"varint,12,opt,name=settlement_height,json=settlementHeight,proto3" json:"settlement_height,omitempty"`
	// max_loss_multiplier is the multiplier coefficient of max loss.
	MaxLossMultiplier github_com_cosmos_cosmos_sdk_types.Dec `` /* 155-byte string literal not displayed */
	// bet_fulfillment is the fulfillment data.
	BetFulfillment []*BetFulfillment `protobuf:"bytes,14,rep,name=bet_fulfillment,json=betFulfillment,proto3" json:"bet_fulfillment,omitempty"`
}

Bet is the transaction order placed by a bettor on a specific event and odd

func NewBet

func NewBet(creator string, bet *PlaceBetFields, oddsType OddsType, odds *BetOdds) *Bet

NewBet creates and returns a new bet from given message

func (*Bet) Descriptor

func (*Bet) Descriptor() ([]byte, []int)

func (*Bet) GetBetFulfillment

func (m *Bet) GetBetFulfillment() []*BetFulfillment

func (*Bet) GetCreatedAt

func (m *Bet) GetCreatedAt() int64

func (*Bet) GetCreator

func (m *Bet) GetCreator() string

func (*Bet) GetMarketUID

func (m *Bet) GetMarketUID() string

func (*Bet) GetOddsType

func (m *Bet) GetOddsType() OddsType

func (*Bet) GetOddsUID

func (m *Bet) GetOddsUID() string

func (*Bet) GetOddsValue

func (m *Bet) GetOddsValue() string

func (*Bet) GetResult

func (m *Bet) GetResult() Bet_Result

func (*Bet) GetSettlementHeight

func (m *Bet) GetSettlementHeight() int64

func (*Bet) GetStatus

func (m *Bet) GetStatus() Bet_Status

func (*Bet) GetUID

func (m *Bet) GetUID() string

func (*Bet) Marshal

func (m *Bet) Marshal() (dAtA []byte, err error)

func (*Bet) MarshalTo

func (m *Bet) MarshalTo(dAtA []byte) (int, error)

func (*Bet) MarshalToSizedBuffer

func (m *Bet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Bet) ProtoMessage

func (*Bet) ProtoMessage()

func (*Bet) Reset

func (m *Bet) Reset()

func (*Bet) Size

func (m *Bet) Size() (n int)

func (*Bet) String

func (m *Bet) String() string

func (*Bet) Unmarshal

func (m *Bet) Unmarshal(dAtA []byte) error

func (*Bet) XXX_DiscardUnknown

func (m *Bet) XXX_DiscardUnknown()

func (*Bet) XXX_Marshal

func (m *Bet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Bet) XXX_Merge

func (m *Bet) XXX_Merge(src proto.Message)

func (*Bet) XXX_Size

func (m *Bet) XXX_Size() int

func (*Bet) XXX_Unmarshal

func (m *Bet) XXX_Unmarshal(b []byte) error

type BetFulfillment

type BetFulfillment struct {
	// participant_address is the bech32-encoded address of the participant
	// fulfilling bet.
	ParticipantAddress string `` /* 142-byte string literal not displayed */
	// participation_index is the index in initial participation queue index
	ParticipationIndex uint64 `` /* 143-byte string literal not displayed */
	// bet amount fulfilled by the participation
	BetAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 146-byte string literal not displayed */
	// payout_profit is the fulfilled profit by the participation.
	PayoutProfit github_com_cosmos_cosmos_sdk_types.Int `` /* 158-byte string literal not displayed */
}

BetFulfillment: A bet can be fulfilled by multiple users participating as a house Every participant is exposed to a share of risk or payout associated with the bet For the risk exposure on a bet, an estimated bet amount is also allocated to the participant This bet amount is the amount participant receive if the bettor loose the bet

func (*BetFulfillment) Descriptor

func (*BetFulfillment) Descriptor() ([]byte, []int)

func (*BetFulfillment) GetParticipantAddress

func (m *BetFulfillment) GetParticipantAddress() string

func (*BetFulfillment) GetParticipationIndex

func (m *BetFulfillment) GetParticipationIndex() uint64

func (*BetFulfillment) Marshal

func (m *BetFulfillment) Marshal() (dAtA []byte, err error)

func (*BetFulfillment) MarshalTo

func (m *BetFulfillment) MarshalTo(dAtA []byte) (int, error)

func (*BetFulfillment) MarshalToSizedBuffer

func (m *BetFulfillment) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BetFulfillment) ProtoMessage

func (*BetFulfillment) ProtoMessage()

func (*BetFulfillment) Reset

func (m *BetFulfillment) Reset()

func (*BetFulfillment) Size

func (m *BetFulfillment) Size() (n int)

func (*BetFulfillment) String

func (m *BetFulfillment) String() string

func (*BetFulfillment) Unmarshal

func (m *BetFulfillment) Unmarshal(dAtA []byte) error

func (*BetFulfillment) XXX_DiscardUnknown

func (m *BetFulfillment) XXX_DiscardUnknown()

func (*BetFulfillment) XXX_Marshal

func (m *BetFulfillment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BetFulfillment) XXX_Merge

func (m *BetFulfillment) XXX_Merge(src proto.Message)

func (*BetFulfillment) XXX_Size

func (m *BetFulfillment) XXX_Size() int

func (*BetFulfillment) XXX_Unmarshal

func (m *BetFulfillment) XXX_Unmarshal(b []byte) error

type BetOdds

type BetOdds struct {
	// uid is universal unique identifier of odds.
	// Required | Unique | uuid-v4 or code
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// market_uid is the parent, used for fast retrieving.
	// Required | NonUnique | -
	MarketUID string `protobuf:"bytes,2,opt,name=market_uid,proto3" json:"market_uid"`
	// value of the odds in corresponding odds type proposed in bet placement
	// message. Required | NonUnique | "1.286" or "2/7" or "+500"
	Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// max_loss_multiplier is the factor for calculating max loss for given odds
	MaxLossMultiplier github_com_cosmos_cosmos_sdk_types.Dec `` /* 131-byte string literal not displayed */
}

BetOdds is the type to store odds of a market.

func (*BetOdds) Descriptor

func (*BetOdds) Descriptor() ([]byte, []int)

func (*BetOdds) GetMarketUID

func (m *BetOdds) GetMarketUID() string

func (*BetOdds) GetUID

func (m *BetOdds) GetUID() string

func (*BetOdds) GetValue

func (m *BetOdds) GetValue() string

func (*BetOdds) Marshal

func (m *BetOdds) Marshal() (dAtA []byte, err error)

func (*BetOdds) MarshalTo

func (m *BetOdds) MarshalTo(dAtA []byte) (int, error)

func (*BetOdds) MarshalToSizedBuffer

func (m *BetOdds) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BetOdds) ProtoMessage

func (*BetOdds) ProtoMessage()

func (*BetOdds) Reset

func (m *BetOdds) Reset()

func (*BetOdds) Size

func (m *BetOdds) Size() (n int)

func (*BetOdds) String

func (m *BetOdds) String() string

func (*BetOdds) Unmarshal

func (m *BetOdds) Unmarshal(dAtA []byte) error

func (*BetOdds) XXX_DiscardUnknown

func (m *BetOdds) XXX_DiscardUnknown()

func (*BetOdds) XXX_Marshal

func (m *BetOdds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BetOdds) XXX_Merge

func (m *BetOdds) XXX_Merge(src proto.Message)

func (*BetOdds) XXX_Size

func (m *BetOdds) XXX_Size() int

func (*BetOdds) XXX_Unmarshal

func (m *BetOdds) XXX_Unmarshal(b []byte) error

type BetPlacementTicketPayload

type BetPlacementTicketPayload struct {
	// selected_odds is the user-selected odds to place bet.
	SelectedOdds *BetOdds `protobuf:"bytes,1,opt,name=selected_odds,json=selectedOdds,proto3" json:"selected_odds,omitempty"`
	// kyc_data contains the details of user kyc.
	KycData KycDataPayload `protobuf:"bytes,2,opt,name=kyc_data,json=kycData,proto3" json:"kyc_data"`
	// odds_type is the type of odds that are going to be placed
	// such as decimal, fraction, moneyline.
	OddsType OddsType `protobuf:"varint,3,opt,name=odds_type,json=oddsType,proto3,enum=furynetwork.fury.bet.OddsType" json:"odds_type,omitempty"`
}

BetPlacementTicketPayload indicates data of bet placement ticket.

func (*BetPlacementTicketPayload) Descriptor

func (*BetPlacementTicketPayload) Descriptor() ([]byte, []int)

func (*BetPlacementTicketPayload) GetKycData

func (m *BetPlacementTicketPayload) GetKycData() KycDataPayload

func (*BetPlacementTicketPayload) GetOddsType

func (m *BetPlacementTicketPayload) GetOddsType() OddsType

func (*BetPlacementTicketPayload) GetSelectedOdds

func (m *BetPlacementTicketPayload) GetSelectedOdds() *BetOdds

func (*BetPlacementTicketPayload) Marshal

func (m *BetPlacementTicketPayload) Marshal() (dAtA []byte, err error)

func (*BetPlacementTicketPayload) MarshalTo

func (m *BetPlacementTicketPayload) MarshalTo(dAtA []byte) (int, error)

func (*BetPlacementTicketPayload) MarshalToSizedBuffer

func (m *BetPlacementTicketPayload) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BetPlacementTicketPayload) ProtoMessage

func (*BetPlacementTicketPayload) ProtoMessage()

func (*BetPlacementTicketPayload) Reset

func (m *BetPlacementTicketPayload) Reset()

func (*BetPlacementTicketPayload) Size

func (m *BetPlacementTicketPayload) Size() (n int)

func (*BetPlacementTicketPayload) String

func (m *BetPlacementTicketPayload) String() string

func (*BetPlacementTicketPayload) Unmarshal

func (m *BetPlacementTicketPayload) Unmarshal(dAtA []byte) error

func (*BetPlacementTicketPayload) Validate

func (ticketData *BetPlacementTicketPayload) Validate(creator string) error

Validate validates fields of the given ticketData

func (*BetPlacementTicketPayload) XXX_DiscardUnknown

func (m *BetPlacementTicketPayload) XXX_DiscardUnknown()

func (*BetPlacementTicketPayload) XXX_Marshal

func (m *BetPlacementTicketPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BetPlacementTicketPayload) XXX_Merge

func (m *BetPlacementTicketPayload) XXX_Merge(src proto.Message)

func (*BetPlacementTicketPayload) XXX_Size

func (m *BetPlacementTicketPayload) XXX_Size() int

func (*BetPlacementTicketPayload) XXX_Unmarshal

func (m *BetPlacementTicketPayload) XXX_Unmarshal(b []byte) error

type BetStats

type BetStats struct {
	// count is the total count of bets.
	Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
}

BetStats is the type of statistics of the betting in the blockchain state.

func (*BetStats) Descriptor

func (*BetStats) Descriptor() ([]byte, []int)

func (*BetStats) GetCount

func (m *BetStats) GetCount() uint64

func (*BetStats) Marshal

func (m *BetStats) Marshal() (dAtA []byte, err error)

func (*BetStats) MarshalTo

func (m *BetStats) MarshalTo(dAtA []byte) (int, error)

func (*BetStats) MarshalToSizedBuffer

func (m *BetStats) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BetStats) ProtoMessage

func (*BetStats) ProtoMessage()

func (*BetStats) Reset

func (m *BetStats) Reset()

func (*BetStats) Size

func (m *BetStats) Size() (n int)

func (*BetStats) String

func (m *BetStats) String() string

func (*BetStats) Unmarshal

func (m *BetStats) Unmarshal(dAtA []byte) error

func (*BetStats) XXX_DiscardUnknown

func (m *BetStats) XXX_DiscardUnknown()

func (*BetStats) XXX_Marshal

func (m *BetStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BetStats) XXX_Merge

func (m *BetStats) XXX_Merge(src proto.Message)

func (*BetStats) XXX_Size

func (m *BetStats) XXX_Size() int

func (*BetStats) XXX_Unmarshal

func (m *BetStats) XXX_Unmarshal(b []byte) error

type Bet_Result

type Bet_Result int32

Result of the bet.

const (
	// the invalid or unknown
	Bet_RESULT_UNSPECIFIED Bet_Result = 0
	// bet result is pending
	Bet_RESULT_PENDING Bet_Result = 1
	// bet won by the bettor
	Bet_RESULT_WON Bet_Result = 2
	// bet lost by the bettor
	Bet_RESULT_LOST Bet_Result = 3
	// bet is refunded
	Bet_RESULT_REFUNDED Bet_Result = 4
)

func (Bet_Result) EnumDescriptor

func (Bet_Result) EnumDescriptor() ([]byte, []int)

func (Bet_Result) String

func (x Bet_Result) String() string

type Bet_Status

type Bet_Status int32

Status of the Bet.

const (
	// the invalid or unknown
	Bet_STATUS_UNSPECIFIED Bet_Status = 0
	// bet is placed
	Bet_STATUS_PLACED Bet_Status = 1
	// bet is canceled by Bettor
	Bet_STATUS_CANCELED Bet_Status = 2
	// bet is aborted
	Bet_STATUS_ABORTED Bet_Status = 3
	// bet is pending for getting placed
	Bet_STATUS_PENDING Bet_Status = 4
	// bet result is declared
	Bet_STATUS_RESULT_DECLARED Bet_Status = 5
	// the bet is settled
	Bet_STATUS_SETTLED Bet_Status = 6
)

func (Bet_Status) EnumDescriptor

func (Bet_Status) EnumDescriptor() ([]byte, []int)

func (Bet_Status) String

func (x Bet_Status) String() string

type DVMKeeper

type DVMKeeper interface {
	VerifyTicketUnmarshal(goCtx context.Context, ticket string, clm interface{}) error
}

DVMKeeper defines the expected interface needed to verify ticket and unmarshal it

type GenesisState

type GenesisState struct {
	// params contains parameters of bet module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// bet_list contains the bet list in the genesis init.
	BetList []Bet `protobuf:"bytes,2,rep,name=bet_list,json=betList,proto3" json:"bet_list"`
	// pending_bet_list contains the pending bet list in the genesis init.
	PendingBetList []PendingBet `protobuf:"bytes,3,rep,name=pending_bet_list,json=pendingBetList,proto3" json:"pending_bet_list"`
	// settled_bet_list contains the settled bet list in the genesis init.
	SettledBetList []SettledBet `protobuf:"bytes,4,rep,name=settled_bet_list,json=settledBetList,proto3" json:"settled_bet_list"`
	// uid2id_list contains bet to id list in the genesis init.
	Uid2IdList []UID2ID `protobuf:"bytes,5,rep,name=uid2id_list,json=uid2idList,proto3" json:"uid2id_list"`
	// stats contains statistics in the genesis init.
	Stats BetStats `protobuf:"bytes,6,opt,name=stats,proto3" json:"stats"`
}

GenesisState defines the bet module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetBetList

func (m *GenesisState) GetBetList() []Bet

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPendingBetList

func (m *GenesisState) GetPendingBetList() []PendingBet

func (*GenesisState) GetSettledBetList

func (m *GenesisState) GetSettledBetList() []SettledBet

func (*GenesisState) GetStats

func (m *GenesisState) GetStats() BetStats

func (*GenesisState) GetUid2IdList

func (m *GenesisState) GetUid2IdList() []UID2ID

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type KycDataPayload

type KycDataPayload struct {
	// ignore is true if kyc validation is not required.
	Ignore bool `protobuf:"varint,1,opt,name=ignore,proto3" json:"ignore,omitempty"`
	// approved represent if kyc validation is approved or not.
	Approved bool `protobuf:"varint,2,opt,name=approved,proto3" json:"approved,omitempty"`
	// id is the id of the kyc user.
	ID string `protobuf:"bytes,3,opt,name=id,proto3" json:"id"`
}

KycDataPayload is the KYC info.

func (*KycDataPayload) Descriptor

func (*KycDataPayload) Descriptor() ([]byte, []int)

func (*KycDataPayload) GetApproved

func (m *KycDataPayload) GetApproved() bool

func (*KycDataPayload) GetID

func (m *KycDataPayload) GetID() string

func (*KycDataPayload) GetIgnore

func (m *KycDataPayload) GetIgnore() bool

func (*KycDataPayload) Marshal

func (m *KycDataPayload) Marshal() (dAtA []byte, err error)

func (*KycDataPayload) MarshalTo

func (m *KycDataPayload) MarshalTo(dAtA []byte) (int, error)

func (*KycDataPayload) MarshalToSizedBuffer

func (m *KycDataPayload) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*KycDataPayload) ProtoMessage

func (*KycDataPayload) ProtoMessage()

func (*KycDataPayload) Reset

func (m *KycDataPayload) Reset()

func (*KycDataPayload) Size

func (m *KycDataPayload) Size() (n int)

func (*KycDataPayload) String

func (m *KycDataPayload) String() string

func (*KycDataPayload) Unmarshal

func (m *KycDataPayload) Unmarshal(dAtA []byte) error

func (*KycDataPayload) XXX_DiscardUnknown

func (m *KycDataPayload) XXX_DiscardUnknown()

func (*KycDataPayload) XXX_Marshal

func (m *KycDataPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KycDataPayload) XXX_Merge

func (m *KycDataPayload) XXX_Merge(src proto.Message)

func (*KycDataPayload) XXX_Size

func (m *KycDataPayload) XXX_Size() int

func (*KycDataPayload) XXX_Unmarshal

func (m *KycDataPayload) XXX_Unmarshal(b []byte) error

type MarketKeeper

type MarketKeeper interface {
	GetMarket(ctx sdk.Context, marketUID string) (markettypes.Market, bool)
	GetFirstUnsettledResolvedMarket(ctx sdk.Context) (string, bool)
	GetDefaultBetConstraints(ctx sdk.Context) (params *markettypes.MarketBetConstraints)
	RemoveUnsettledResolvedMarket(ctx sdk.Context, marketUID string)
}

MarketKeeper defines the expected interface needed to get markets from KVStore

type MsgClient

type MsgClient interface {
	// PlaceBet defines a method to place a bet with the given data.
	PlaceBet(ctx context.Context, in *MsgPlaceBet, opts ...grpc.CallOption) (*MsgPlaceBetResponse, error)
}

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.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgPlaceBet

type MsgPlaceBet struct {
	// creator is the bettor address.
	Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
	// PlaceBetFields contains bet fields.
	Bet *PlaceBetFields `protobuf:"bytes,2,opt,name=bet,proto3" json:"bet,omitempty"`
}

MsgPlaceBet defines a message to place a bet with the given data.

func NewMsgPlaceBet

func NewMsgPlaceBet(
	creator string,
	bet PlaceBetFields,
) *MsgPlaceBet

NewMsgPlaceBet returns a MsgPlaceBet using given data

func (*MsgPlaceBet) Descriptor

func (*MsgPlaceBet) Descriptor() ([]byte, []int)

func (*MsgPlaceBet) GetBet

func (m *MsgPlaceBet) GetBet() *PlaceBetFields

func (*MsgPlaceBet) GetCreator

func (m *MsgPlaceBet) GetCreator() string

func (*MsgPlaceBet) GetSignBytes

func (msg *MsgPlaceBet) GetSignBytes() []byte

GetSignBytes returns sortJson form of its message

func (*MsgPlaceBet) GetSigners

func (msg *MsgPlaceBet) GetSigners() []sdk.AccAddress

GetSigners returns the signers of its message

func (*MsgPlaceBet) Marshal

func (m *MsgPlaceBet) Marshal() (dAtA []byte, err error)

func (*MsgPlaceBet) MarshalTo

func (m *MsgPlaceBet) MarshalTo(dAtA []byte) (int, error)

func (*MsgPlaceBet) MarshalToSizedBuffer

func (m *MsgPlaceBet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPlaceBet) ProtoMessage

func (*MsgPlaceBet) ProtoMessage()

func (*MsgPlaceBet) Reset

func (m *MsgPlaceBet) Reset()

func (*MsgPlaceBet) Route

func (msg *MsgPlaceBet) Route() string

Route returns the module's message router key.

func (*MsgPlaceBet) Size

func (m *MsgPlaceBet) Size() (n int)

func (*MsgPlaceBet) String

func (m *MsgPlaceBet) String() string

func (*MsgPlaceBet) Type

func (msg *MsgPlaceBet) Type() string

Type returns type of its message

func (*MsgPlaceBet) Unmarshal

func (m *MsgPlaceBet) Unmarshal(dAtA []byte) error

func (*MsgPlaceBet) ValidateBasic

func (msg *MsgPlaceBet) ValidateBasic() error

ValidateBasic does some validate checks on its message

func (*MsgPlaceBet) XXX_DiscardUnknown

func (m *MsgPlaceBet) XXX_DiscardUnknown()

func (*MsgPlaceBet) XXX_Marshal

func (m *MsgPlaceBet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPlaceBet) XXX_Merge

func (m *MsgPlaceBet) XXX_Merge(src proto.Message)

func (*MsgPlaceBet) XXX_Size

func (m *MsgPlaceBet) XXX_Size() int

func (*MsgPlaceBet) XXX_Unmarshal

func (m *MsgPlaceBet) XXX_Unmarshal(b []byte) error

type MsgPlaceBetResponse

type MsgPlaceBetResponse struct {
	Bet *PlaceBetFields `protobuf:"bytes,1,opt,name=bet,proto3" json:"bet,omitempty"`
}

MsgPlaceBetResponse is the returning value in the response of MsgPlaceBet request.

func (*MsgPlaceBetResponse) Descriptor

func (*MsgPlaceBetResponse) Descriptor() ([]byte, []int)

func (*MsgPlaceBetResponse) GetBet

func (m *MsgPlaceBetResponse) GetBet() *PlaceBetFields

func (*MsgPlaceBetResponse) Marshal

func (m *MsgPlaceBetResponse) Marshal() (dAtA []byte, err error)

func (*MsgPlaceBetResponse) MarshalTo

func (m *MsgPlaceBetResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgPlaceBetResponse) MarshalToSizedBuffer

func (m *MsgPlaceBetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgPlaceBetResponse) ProtoMessage

func (*MsgPlaceBetResponse) ProtoMessage()

func (*MsgPlaceBetResponse) Reset

func (m *MsgPlaceBetResponse) Reset()

func (*MsgPlaceBetResponse) Size

func (m *MsgPlaceBetResponse) Size() (n int)

func (*MsgPlaceBetResponse) String

func (m *MsgPlaceBetResponse) String() string

func (*MsgPlaceBetResponse) Unmarshal

func (m *MsgPlaceBetResponse) Unmarshal(dAtA []byte) error

func (*MsgPlaceBetResponse) XXX_DiscardUnknown

func (m *MsgPlaceBetResponse) XXX_DiscardUnknown()

func (*MsgPlaceBetResponse) XXX_Marshal

func (m *MsgPlaceBetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgPlaceBetResponse) XXX_Merge

func (m *MsgPlaceBetResponse) XXX_Merge(src proto.Message)

func (*MsgPlaceBetResponse) XXX_Size

func (m *MsgPlaceBetResponse) XXX_Size() int

func (*MsgPlaceBetResponse) XXX_Unmarshal

func (m *MsgPlaceBetResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// PlaceBet defines a method to place a bet with the given data.
	PlaceBet(context.Context, *MsgPlaceBet) (*MsgPlaceBetResponse, error)
}

MsgServer is the server API for Msg service.

type OddsType

type OddsType int32

OddsType is the representation of the type of the odds.

const (
	// invalid odds type
	OddsType_ODDS_TYPE_UNSPECIFIED OddsType = 0
	// decimal odds type (european)
	OddsType_ODDS_TYPE_DECIMAL OddsType = 1
	// fractional odds type (british)
	OddsType_ODDS_TYPE_FRACTIONAL OddsType = 2
	// moneyline odds type (american)
	OddsType_ODDS_TYPE_MONEYLINE OddsType = 3
)

func (OddsType) EnumDescriptor

func (OddsType) EnumDescriptor() ([]byte, []int)

func (OddsType) String

func (x OddsType) String() string

type OddsTypeI

type OddsTypeI interface {
	// CalculatePayout calculates total payout of a certain bet amount
	CalculatePayout(oddsVal string, amount sdk.Int) (sdk.Dec, error)

	// CalculateBetAmount calculates bet amount
	CalculateBetAmount(oddsVal string, payoutProfit sdk.Dec) (sdk.Dec, error)
}

type Params

type Params struct {
	// batch_settlement_count is the batch settlement bet count.
	BatchSettlementCount uint32 `protobuf:"varint,1,opt,name=batch_settlement_count,json=batchSettlementCount,proto3" json:"batch_settlement_count,omitempty"`
}

Params defines the parameters for the module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams() Params

NewParams creates a new Params instance

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetBatchSettlementCount

func (m *Params) GetBatchSettlementCount() uint32

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs get the params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String implements the Stringer interface.

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate validates the set of params

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type PendingBet

type PendingBet struct {
	// uid is the universal unique identifier for the bet.
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// creator is the bettor address.
	Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
}

PendingBet is the type for an unsettled bet

func NewPendingBet

func NewPendingBet(uid, creator string) *PendingBet

func (*PendingBet) Descriptor

func (*PendingBet) Descriptor() ([]byte, []int)

func (*PendingBet) GetCreator

func (m *PendingBet) GetCreator() string

func (*PendingBet) GetUID

func (m *PendingBet) GetUID() string

func (*PendingBet) Marshal

func (m *PendingBet) Marshal() (dAtA []byte, err error)

func (*PendingBet) MarshalTo

func (m *PendingBet) MarshalTo(dAtA []byte) (int, error)

func (*PendingBet) MarshalToSizedBuffer

func (m *PendingBet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PendingBet) ProtoMessage

func (*PendingBet) ProtoMessage()

func (*PendingBet) Reset

func (m *PendingBet) Reset()

func (*PendingBet) Size

func (m *PendingBet) Size() (n int)

func (*PendingBet) String

func (m *PendingBet) String() string

func (*PendingBet) Unmarshal

func (m *PendingBet) Unmarshal(dAtA []byte) error

func (*PendingBet) XXX_DiscardUnknown

func (m *PendingBet) XXX_DiscardUnknown()

func (*PendingBet) XXX_Marshal

func (m *PendingBet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PendingBet) XXX_Merge

func (m *PendingBet) XXX_Merge(src proto.Message)

func (*PendingBet) XXX_Size

func (m *PendingBet) XXX_Size() int

func (*PendingBet) XXX_Unmarshal

func (m *PendingBet) XXX_Unmarshal(b []byte) error

type PlaceBetFields

type PlaceBetFields struct {
	// uid is the universal unique identifier assigned to bet.
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// amount is the wager amount.
	Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
	// ticket is a signed string containing important info such as `oddsValue`.
	Ticket string `protobuf:"bytes,3,opt,name=ticket,proto3" json:"ticket,omitempty"`
}

PlaceBetFields contains attributes which come in Place bet tx request.

func (*PlaceBetFields) Descriptor

func (*PlaceBetFields) Descriptor() ([]byte, []int)

func (*PlaceBetFields) GetTicket

func (m *PlaceBetFields) GetTicket() string

func (*PlaceBetFields) GetUID

func (m *PlaceBetFields) GetUID() string

func (*PlaceBetFields) Marshal

func (m *PlaceBetFields) Marshal() (dAtA []byte, err error)

func (*PlaceBetFields) MarshalTo

func (m *PlaceBetFields) MarshalTo(dAtA []byte) (int, error)

func (*PlaceBetFields) MarshalToSizedBuffer

func (m *PlaceBetFields) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PlaceBetFields) ProtoMessage

func (*PlaceBetFields) ProtoMessage()

func (*PlaceBetFields) Reset

func (m *PlaceBetFields) Reset()

func (*PlaceBetFields) Size

func (m *PlaceBetFields) Size() (n int)

func (*PlaceBetFields) String

func (m *PlaceBetFields) String() string

func (*PlaceBetFields) Unmarshal

func (m *PlaceBetFields) Unmarshal(dAtA []byte) error

func (*PlaceBetFields) XXX_DiscardUnknown

func (m *PlaceBetFields) XXX_DiscardUnknown()

func (*PlaceBetFields) XXX_Marshal

func (m *PlaceBetFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlaceBetFields) XXX_Merge

func (m *PlaceBetFields) XXX_Merge(src proto.Message)

func (*PlaceBetFields) XXX_Size

func (m *PlaceBetFields) XXX_Size() int

func (*PlaceBetFields) XXX_Unmarshal

func (m *PlaceBetFields) XXX_Unmarshal(b []byte) error

type QueryBetRequest

type QueryBetRequest struct {
	Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
	Uid     string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
}

QueryBetRequest is the request type for a single bet query Query/Bet RPC method.

func (*QueryBetRequest) Descriptor

func (*QueryBetRequest) Descriptor() ([]byte, []int)

func (*QueryBetRequest) GetCreator

func (m *QueryBetRequest) GetCreator() string

func (*QueryBetRequest) GetUid

func (m *QueryBetRequest) GetUid() string

func (*QueryBetRequest) Marshal

func (m *QueryBetRequest) Marshal() (dAtA []byte, err error)

func (*QueryBetRequest) MarshalTo

func (m *QueryBetRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetRequest) MarshalToSizedBuffer

func (m *QueryBetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetRequest) ProtoMessage

func (*QueryBetRequest) ProtoMessage()

func (*QueryBetRequest) Reset

func (m *QueryBetRequest) Reset()

func (*QueryBetRequest) Size

func (m *QueryBetRequest) Size() (n int)

func (*QueryBetRequest) String

func (m *QueryBetRequest) String() string

func (*QueryBetRequest) Unmarshal

func (m *QueryBetRequest) Unmarshal(dAtA []byte) error

func (*QueryBetRequest) XXX_DiscardUnknown

func (m *QueryBetRequest) XXX_DiscardUnknown()

func (*QueryBetRequest) XXX_Marshal

func (m *QueryBetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetRequest) XXX_Merge

func (m *QueryBetRequest) XXX_Merge(src proto.Message)

func (*QueryBetRequest) XXX_Size

func (m *QueryBetRequest) XXX_Size() int

func (*QueryBetRequest) XXX_Unmarshal

func (m *QueryBetRequest) XXX_Unmarshal(b []byte) error

type QueryBetResponse

type QueryBetResponse struct {
	Bet    Bet          `protobuf:"bytes,1,opt,name=bet,proto3" json:"bet"`
	Market types.Market `protobuf:"bytes,2,opt,name=market,proto3" json:"market"`
}

QueryBetResponse is the response type for single bet query Query/Bet RPC method.

func (*QueryBetResponse) Descriptor

func (*QueryBetResponse) Descriptor() ([]byte, []int)

func (*QueryBetResponse) GetBet

func (m *QueryBetResponse) GetBet() Bet

func (*QueryBetResponse) GetMarket

func (m *QueryBetResponse) GetMarket() types.Market

func (*QueryBetResponse) Marshal

func (m *QueryBetResponse) Marshal() (dAtA []byte, err error)

func (*QueryBetResponse) MarshalTo

func (m *QueryBetResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetResponse) MarshalToSizedBuffer

func (m *QueryBetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetResponse) ProtoMessage

func (*QueryBetResponse) ProtoMessage()

func (*QueryBetResponse) Reset

func (m *QueryBetResponse) Reset()

func (*QueryBetResponse) Size

func (m *QueryBetResponse) Size() (n int)

func (*QueryBetResponse) String

func (m *QueryBetResponse) String() string

func (*QueryBetResponse) Unmarshal

func (m *QueryBetResponse) Unmarshal(dAtA []byte) error

func (*QueryBetResponse) XXX_DiscardUnknown

func (m *QueryBetResponse) XXX_DiscardUnknown()

func (*QueryBetResponse) XXX_Marshal

func (m *QueryBetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetResponse) XXX_Merge

func (m *QueryBetResponse) XXX_Merge(src proto.Message)

func (*QueryBetResponse) XXX_Size

func (m *QueryBetResponse) XXX_Size() int

func (*QueryBetResponse) XXX_Unmarshal

func (m *QueryBetResponse) XXX_Unmarshal(b []byte) error

type QueryBetsByCreatorRequest

type QueryBetsByCreatorRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	Creator    string             `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
}

QueryBetsByUIDsResponse is the request type for bets list of all bets of a bettor Query/BetsByCreator RPC method.

func (*QueryBetsByCreatorRequest) Descriptor

func (*QueryBetsByCreatorRequest) Descriptor() ([]byte, []int)

func (*QueryBetsByCreatorRequest) GetCreator

func (m *QueryBetsByCreatorRequest) GetCreator() string

func (*QueryBetsByCreatorRequest) GetPagination

func (m *QueryBetsByCreatorRequest) GetPagination() *query.PageRequest

func (*QueryBetsByCreatorRequest) Marshal

func (m *QueryBetsByCreatorRequest) Marshal() (dAtA []byte, err error)

func (*QueryBetsByCreatorRequest) MarshalTo

func (m *QueryBetsByCreatorRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsByCreatorRequest) MarshalToSizedBuffer

func (m *QueryBetsByCreatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsByCreatorRequest) ProtoMessage

func (*QueryBetsByCreatorRequest) ProtoMessage()

func (*QueryBetsByCreatorRequest) Reset

func (m *QueryBetsByCreatorRequest) Reset()

func (*QueryBetsByCreatorRequest) Size

func (m *QueryBetsByCreatorRequest) Size() (n int)

func (*QueryBetsByCreatorRequest) String

func (m *QueryBetsByCreatorRequest) String() string

func (*QueryBetsByCreatorRequest) Unmarshal

func (m *QueryBetsByCreatorRequest) Unmarshal(dAtA []byte) error

func (*QueryBetsByCreatorRequest) XXX_DiscardUnknown

func (m *QueryBetsByCreatorRequest) XXX_DiscardUnknown()

func (*QueryBetsByCreatorRequest) XXX_Marshal

func (m *QueryBetsByCreatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsByCreatorRequest) XXX_Merge

func (m *QueryBetsByCreatorRequest) XXX_Merge(src proto.Message)

func (*QueryBetsByCreatorRequest) XXX_Size

func (m *QueryBetsByCreatorRequest) XXX_Size() int

func (*QueryBetsByCreatorRequest) XXX_Unmarshal

func (m *QueryBetsByCreatorRequest) XXX_Unmarshal(b []byte) error

type QueryBetsByCreatorResponse

type QueryBetsByCreatorResponse struct {
	Bet        []Bet               `protobuf:"bytes,1,rep,name=bet,proto3" json:"bet"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryBetsByCreatorResponse is the response type for the bets list of all bets of a bettor Query/BetsByCreator RPC method.

func (*QueryBetsByCreatorResponse) Descriptor

func (*QueryBetsByCreatorResponse) Descriptor() ([]byte, []int)

func (*QueryBetsByCreatorResponse) GetBet

func (m *QueryBetsByCreatorResponse) GetBet() []Bet

func (*QueryBetsByCreatorResponse) GetPagination

func (m *QueryBetsByCreatorResponse) GetPagination() *query.PageResponse

func (*QueryBetsByCreatorResponse) Marshal

func (m *QueryBetsByCreatorResponse) Marshal() (dAtA []byte, err error)

func (*QueryBetsByCreatorResponse) MarshalTo

func (m *QueryBetsByCreatorResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsByCreatorResponse) MarshalToSizedBuffer

func (m *QueryBetsByCreatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsByCreatorResponse) ProtoMessage

func (*QueryBetsByCreatorResponse) ProtoMessage()

func (*QueryBetsByCreatorResponse) Reset

func (m *QueryBetsByCreatorResponse) Reset()

func (*QueryBetsByCreatorResponse) Size

func (m *QueryBetsByCreatorResponse) Size() (n int)

func (*QueryBetsByCreatorResponse) String

func (m *QueryBetsByCreatorResponse) String() string

func (*QueryBetsByCreatorResponse) Unmarshal

func (m *QueryBetsByCreatorResponse) Unmarshal(dAtA []byte) error

func (*QueryBetsByCreatorResponse) XXX_DiscardUnknown

func (m *QueryBetsByCreatorResponse) XXX_DiscardUnknown()

func (*QueryBetsByCreatorResponse) XXX_Marshal

func (m *QueryBetsByCreatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsByCreatorResponse) XXX_Merge

func (m *QueryBetsByCreatorResponse) XXX_Merge(src proto.Message)

func (*QueryBetsByCreatorResponse) XXX_Size

func (m *QueryBetsByCreatorResponse) XXX_Size() int

func (*QueryBetsByCreatorResponse) XXX_Unmarshal

func (m *QueryBetsByCreatorResponse) XXX_Unmarshal(b []byte) error

type QueryBetsByUIDsRequest

type QueryBetsByUIDsRequest struct {
	Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items"`
}

QueryBetsByUIDsRequest is the request type for a bets list of a certain UID list input Query/BetsByUIDs RPC method.

func (*QueryBetsByUIDsRequest) Descriptor

func (*QueryBetsByUIDsRequest) Descriptor() ([]byte, []int)

func (*QueryBetsByUIDsRequest) GetItems

func (m *QueryBetsByUIDsRequest) GetItems() []string

func (*QueryBetsByUIDsRequest) Marshal

func (m *QueryBetsByUIDsRequest) Marshal() (dAtA []byte, err error)

func (*QueryBetsByUIDsRequest) MarshalTo

func (m *QueryBetsByUIDsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsByUIDsRequest) MarshalToSizedBuffer

func (m *QueryBetsByUIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsByUIDsRequest) ProtoMessage

func (*QueryBetsByUIDsRequest) ProtoMessage()

func (*QueryBetsByUIDsRequest) Reset

func (m *QueryBetsByUIDsRequest) Reset()

func (*QueryBetsByUIDsRequest) Size

func (m *QueryBetsByUIDsRequest) Size() (n int)

func (*QueryBetsByUIDsRequest) String

func (m *QueryBetsByUIDsRequest) String() string

func (*QueryBetsByUIDsRequest) Unmarshal

func (m *QueryBetsByUIDsRequest) Unmarshal(dAtA []byte) error

func (*QueryBetsByUIDsRequest) XXX_DiscardUnknown

func (m *QueryBetsByUIDsRequest) XXX_DiscardUnknown()

func (*QueryBetsByUIDsRequest) XXX_Marshal

func (m *QueryBetsByUIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsByUIDsRequest) XXX_Merge

func (m *QueryBetsByUIDsRequest) XXX_Merge(src proto.Message)

func (*QueryBetsByUIDsRequest) XXX_Size

func (m *QueryBetsByUIDsRequest) XXX_Size() int

func (*QueryBetsByUIDsRequest) XXX_Unmarshal

func (m *QueryBetsByUIDsRequest) XXX_Unmarshal(b []byte) error

type QueryBetsByUIDsResponse

type QueryBetsByUIDsResponse struct {
	Bets            []Bet    `protobuf:"bytes,1,rep,name=bets,proto3" json:"bets"`
	NotFoundBetUids []string `protobuf:"bytes,2,rep,name=not_found_bet_uids,json=notFoundBetUids,proto3" json:"not_found_bet_uids,omitempty"`
}

QueryBetsByUIDsResponse is the response type for the bets list of a certain UID list input Query/BetsByUIDs RPC method.

func (*QueryBetsByUIDsResponse) Descriptor

func (*QueryBetsByUIDsResponse) Descriptor() ([]byte, []int)

func (*QueryBetsByUIDsResponse) GetBets

func (m *QueryBetsByUIDsResponse) GetBets() []Bet

func (*QueryBetsByUIDsResponse) GetNotFoundBetUids

func (m *QueryBetsByUIDsResponse) GetNotFoundBetUids() []string

func (*QueryBetsByUIDsResponse) Marshal

func (m *QueryBetsByUIDsResponse) Marshal() (dAtA []byte, err error)

func (*QueryBetsByUIDsResponse) MarshalTo

func (m *QueryBetsByUIDsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsByUIDsResponse) MarshalToSizedBuffer

func (m *QueryBetsByUIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsByUIDsResponse) ProtoMessage

func (*QueryBetsByUIDsResponse) ProtoMessage()

func (*QueryBetsByUIDsResponse) Reset

func (m *QueryBetsByUIDsResponse) Reset()

func (*QueryBetsByUIDsResponse) Size

func (m *QueryBetsByUIDsResponse) Size() (n int)

func (*QueryBetsByUIDsResponse) String

func (m *QueryBetsByUIDsResponse) String() string

func (*QueryBetsByUIDsResponse) Unmarshal

func (m *QueryBetsByUIDsResponse) Unmarshal(dAtA []byte) error

func (*QueryBetsByUIDsResponse) XXX_DiscardUnknown

func (m *QueryBetsByUIDsResponse) XXX_DiscardUnknown()

func (*QueryBetsByUIDsResponse) XXX_Marshal

func (m *QueryBetsByUIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsByUIDsResponse) XXX_Merge

func (m *QueryBetsByUIDsResponse) XXX_Merge(src proto.Message)

func (*QueryBetsByUIDsResponse) XXX_Size

func (m *QueryBetsByUIDsResponse) XXX_Size() int

func (*QueryBetsByUIDsResponse) XXX_Unmarshal

func (m *QueryBetsByUIDsResponse) XXX_Unmarshal(b []byte) error

type QueryBetsRequest

type QueryBetsRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryBetsRequest is the request type for the bets list query Query/Bets RPC method.

func (*QueryBetsRequest) Descriptor

func (*QueryBetsRequest) Descriptor() ([]byte, []int)

func (*QueryBetsRequest) GetPagination

func (m *QueryBetsRequest) GetPagination() *query.PageRequest

func (*QueryBetsRequest) Marshal

func (m *QueryBetsRequest) Marshal() (dAtA []byte, err error)

func (*QueryBetsRequest) MarshalTo

func (m *QueryBetsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsRequest) MarshalToSizedBuffer

func (m *QueryBetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsRequest) ProtoMessage

func (*QueryBetsRequest) ProtoMessage()

func (*QueryBetsRequest) Reset

func (m *QueryBetsRequest) Reset()

func (*QueryBetsRequest) Size

func (m *QueryBetsRequest) Size() (n int)

func (*QueryBetsRequest) String

func (m *QueryBetsRequest) String() string

func (*QueryBetsRequest) Unmarshal

func (m *QueryBetsRequest) Unmarshal(dAtA []byte) error

func (*QueryBetsRequest) XXX_DiscardUnknown

func (m *QueryBetsRequest) XXX_DiscardUnknown()

func (*QueryBetsRequest) XXX_Marshal

func (m *QueryBetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsRequest) XXX_Merge

func (m *QueryBetsRequest) XXX_Merge(src proto.Message)

func (*QueryBetsRequest) XXX_Size

func (m *QueryBetsRequest) XXX_Size() int

func (*QueryBetsRequest) XXX_Unmarshal

func (m *QueryBetsRequest) XXX_Unmarshal(b []byte) error

type QueryBetsResponse

type QueryBetsResponse struct {
	Bet        []Bet               `protobuf:"bytes,1,rep,name=bet,proto3" json:"bet"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryBetsResponse is the response type for the bets list query Query/Bets RPC method.

func (*QueryBetsResponse) Descriptor

func (*QueryBetsResponse) Descriptor() ([]byte, []int)

func (*QueryBetsResponse) GetBet

func (m *QueryBetsResponse) GetBet() []Bet

func (*QueryBetsResponse) GetPagination

func (m *QueryBetsResponse) GetPagination() *query.PageResponse

func (*QueryBetsResponse) Marshal

func (m *QueryBetsResponse) Marshal() (dAtA []byte, err error)

func (*QueryBetsResponse) MarshalTo

func (m *QueryBetsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBetsResponse) MarshalToSizedBuffer

func (m *QueryBetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBetsResponse) ProtoMessage

func (*QueryBetsResponse) ProtoMessage()

func (*QueryBetsResponse) Reset

func (m *QueryBetsResponse) Reset()

func (*QueryBetsResponse) Size

func (m *QueryBetsResponse) Size() (n int)

func (*QueryBetsResponse) String

func (m *QueryBetsResponse) String() string

func (*QueryBetsResponse) Unmarshal

func (m *QueryBetsResponse) Unmarshal(dAtA []byte) error

func (*QueryBetsResponse) XXX_DiscardUnknown

func (m *QueryBetsResponse) XXX_DiscardUnknown()

func (*QueryBetsResponse) XXX_Marshal

func (m *QueryBetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBetsResponse) XXX_Merge

func (m *QueryBetsResponse) XXX_Merge(src proto.Message)

func (*QueryBetsResponse) XXX_Size

func (m *QueryBetsResponse) XXX_Size() int

func (*QueryBetsResponse) XXX_Unmarshal

func (m *QueryBetsResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Params queries the parameters of the module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Queries a Bet by uid.
	Bet(ctx context.Context, in *QueryBetRequest, opts ...grpc.CallOption) (*QueryBetResponse, error)
	// Queries list of Bet items of a certain creator sorted by timestamp.
	BetsByCreator(ctx context.Context, in *QueryBetsByCreatorRequest, opts ...grpc.CallOption) (*QueryBetsByCreatorResponse, error)
	// Queries list of Bet items.
	Bets(ctx context.Context, in *QueryBetsRequest, opts ...grpc.CallOption) (*QueryBetsResponse, error)
	// Queries list of pending Bet items.
	PendingBets(ctx context.Context, in *QueryPendingBetsRequest, opts ...grpc.CallOption) (*QueryPendingBetsResponse, error)
	// Queries list of settled Bet items of a certain height.
	SettledBetsOfHeight(ctx context.Context, in *QuerySettledBetsOfHeightRequest, opts ...grpc.CallOption) (*QuerySettledBetsOfHeightResponse, error)
	// Queries a list of Bet items filtered by uid list.
	BetsByUIDs(ctx context.Context, in *QueryBetsByUIDsRequest, opts ...grpc.CallOption) (*QueryBetsByUIDsResponse, error)
}

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.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method. Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	// params holds all the parameters of this module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method. Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryPendingBetsRequest

type QueryPendingBetsRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	MarketUid  string             `protobuf:"bytes,2,opt,name=market_uid,json=marketUid,proto3" json:"market_uid,omitempty"`
}

QueryPendingBetsRequest is the request type for the active bets list query for a market Query/ActiveBets RPC method.

func (*QueryPendingBetsRequest) Descriptor

func (*QueryPendingBetsRequest) Descriptor() ([]byte, []int)

func (*QueryPendingBetsRequest) GetMarketUid

func (m *QueryPendingBetsRequest) GetMarketUid() string

func (*QueryPendingBetsRequest) GetPagination

func (m *QueryPendingBetsRequest) GetPagination() *query.PageRequest

func (*QueryPendingBetsRequest) Marshal

func (m *QueryPendingBetsRequest) Marshal() (dAtA []byte, err error)

func (*QueryPendingBetsRequest) MarshalTo

func (m *QueryPendingBetsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPendingBetsRequest) MarshalToSizedBuffer

func (m *QueryPendingBetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPendingBetsRequest) ProtoMessage

func (*QueryPendingBetsRequest) ProtoMessage()

func (*QueryPendingBetsRequest) Reset

func (m *QueryPendingBetsRequest) Reset()

func (*QueryPendingBetsRequest) Size

func (m *QueryPendingBetsRequest) Size() (n int)

func (*QueryPendingBetsRequest) String

func (m *QueryPendingBetsRequest) String() string

func (*QueryPendingBetsRequest) Unmarshal

func (m *QueryPendingBetsRequest) Unmarshal(dAtA []byte) error

func (*QueryPendingBetsRequest) XXX_DiscardUnknown

func (m *QueryPendingBetsRequest) XXX_DiscardUnknown()

func (*QueryPendingBetsRequest) XXX_Marshal

func (m *QueryPendingBetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPendingBetsRequest) XXX_Merge

func (m *QueryPendingBetsRequest) XXX_Merge(src proto.Message)

func (*QueryPendingBetsRequest) XXX_Size

func (m *QueryPendingBetsRequest) XXX_Size() int

func (*QueryPendingBetsRequest) XXX_Unmarshal

func (m *QueryPendingBetsRequest) XXX_Unmarshal(b []byte) error

type QueryPendingBetsResponse

type QueryPendingBetsResponse struct {
	Bet        []Bet               `protobuf:"bytes,1,rep,name=bet,proto3" json:"bet"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryPendingBetsResponse is the response type for the active bets list query Query/PendingBets RPC method.

func (*QueryPendingBetsResponse) Descriptor

func (*QueryPendingBetsResponse) Descriptor() ([]byte, []int)

func (*QueryPendingBetsResponse) GetBet

func (m *QueryPendingBetsResponse) GetBet() []Bet

func (*QueryPendingBetsResponse) GetPagination

func (m *QueryPendingBetsResponse) GetPagination() *query.PageResponse

func (*QueryPendingBetsResponse) Marshal

func (m *QueryPendingBetsResponse) Marshal() (dAtA []byte, err error)

func (*QueryPendingBetsResponse) MarshalTo

func (m *QueryPendingBetsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPendingBetsResponse) MarshalToSizedBuffer

func (m *QueryPendingBetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPendingBetsResponse) ProtoMessage

func (*QueryPendingBetsResponse) ProtoMessage()

func (*QueryPendingBetsResponse) Reset

func (m *QueryPendingBetsResponse) Reset()

func (*QueryPendingBetsResponse) Size

func (m *QueryPendingBetsResponse) Size() (n int)

func (*QueryPendingBetsResponse) String

func (m *QueryPendingBetsResponse) String() string

func (*QueryPendingBetsResponse) Unmarshal

func (m *QueryPendingBetsResponse) Unmarshal(dAtA []byte) error

func (*QueryPendingBetsResponse) XXX_DiscardUnknown

func (m *QueryPendingBetsResponse) XXX_DiscardUnknown()

func (*QueryPendingBetsResponse) XXX_Marshal

func (m *QueryPendingBetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPendingBetsResponse) XXX_Merge

func (m *QueryPendingBetsResponse) XXX_Merge(src proto.Message)

func (*QueryPendingBetsResponse) XXX_Size

func (m *QueryPendingBetsResponse) XXX_Size() int

func (*QueryPendingBetsResponse) XXX_Unmarshal

func (m *QueryPendingBetsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Params queries the parameters of the module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Queries a Bet by uid.
	Bet(context.Context, *QueryBetRequest) (*QueryBetResponse, error)
	// Queries list of Bet items of a certain creator sorted by timestamp.
	BetsByCreator(context.Context, *QueryBetsByCreatorRequest) (*QueryBetsByCreatorResponse, error)
	// Queries list of Bet items.
	Bets(context.Context, *QueryBetsRequest) (*QueryBetsResponse, error)
	// Queries list of pending Bet items.
	PendingBets(context.Context, *QueryPendingBetsRequest) (*QueryPendingBetsResponse, error)
	// Queries list of settled Bet items of a certain height.
	SettledBetsOfHeight(context.Context, *QuerySettledBetsOfHeightRequest) (*QuerySettledBetsOfHeightResponse, error)
	// Queries a list of Bet items filtered by uid list.
	BetsByUIDs(context.Context, *QueryBetsByUIDsRequest) (*QueryBetsByUIDsResponse, error)
}

QueryServer is the server API for Query service.

type QuerySettledBetsOfHeightRequest

type QuerySettledBetsOfHeightRequest struct {
	Pagination  *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	BlockHeight int64              `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
}

QuerySettledBetsOfHeightRequest is the request type for the settled bets of a certain height list query. Query/ActiveBets RPC method.

func (*QuerySettledBetsOfHeightRequest) Descriptor

func (*QuerySettledBetsOfHeightRequest) Descriptor() ([]byte, []int)

func (*QuerySettledBetsOfHeightRequest) GetBlockHeight

func (m *QuerySettledBetsOfHeightRequest) GetBlockHeight() int64

func (*QuerySettledBetsOfHeightRequest) GetPagination

func (*QuerySettledBetsOfHeightRequest) Marshal

func (m *QuerySettledBetsOfHeightRequest) Marshal() (dAtA []byte, err error)

func (*QuerySettledBetsOfHeightRequest) MarshalTo

func (m *QuerySettledBetsOfHeightRequest) MarshalTo(dAtA []byte) (int, error)

func (*QuerySettledBetsOfHeightRequest) MarshalToSizedBuffer

func (m *QuerySettledBetsOfHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySettledBetsOfHeightRequest) ProtoMessage

func (*QuerySettledBetsOfHeightRequest) ProtoMessage()

func (*QuerySettledBetsOfHeightRequest) Reset

func (*QuerySettledBetsOfHeightRequest) Size

func (m *QuerySettledBetsOfHeightRequest) Size() (n int)

func (*QuerySettledBetsOfHeightRequest) String

func (*QuerySettledBetsOfHeightRequest) Unmarshal

func (m *QuerySettledBetsOfHeightRequest) Unmarshal(dAtA []byte) error

func (*QuerySettledBetsOfHeightRequest) XXX_DiscardUnknown

func (m *QuerySettledBetsOfHeightRequest) XXX_DiscardUnknown()

func (*QuerySettledBetsOfHeightRequest) XXX_Marshal

func (m *QuerySettledBetsOfHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySettledBetsOfHeightRequest) XXX_Merge

func (m *QuerySettledBetsOfHeightRequest) XXX_Merge(src proto.Message)

func (*QuerySettledBetsOfHeightRequest) XXX_Size

func (m *QuerySettledBetsOfHeightRequest) XXX_Size() int

func (*QuerySettledBetsOfHeightRequest) XXX_Unmarshal

func (m *QuerySettledBetsOfHeightRequest) XXX_Unmarshal(b []byte) error

type QuerySettledBetsOfHeightResponse

type QuerySettledBetsOfHeightResponse struct {
	Bet        []Bet               `protobuf:"bytes,1,rep,name=bet,proto3" json:"bet"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySettledBetsOfHeightResponse is the response type for the settled bets of a certain height list query Query/ActiveBets RPC method.

func (*QuerySettledBetsOfHeightResponse) Descriptor

func (*QuerySettledBetsOfHeightResponse) Descriptor() ([]byte, []int)

func (*QuerySettledBetsOfHeightResponse) GetBet

func (m *QuerySettledBetsOfHeightResponse) GetBet() []Bet

func (*QuerySettledBetsOfHeightResponse) GetPagination

func (*QuerySettledBetsOfHeightResponse) Marshal

func (m *QuerySettledBetsOfHeightResponse) Marshal() (dAtA []byte, err error)

func (*QuerySettledBetsOfHeightResponse) MarshalTo

func (m *QuerySettledBetsOfHeightResponse) MarshalTo(dAtA []byte) (int, error)

func (*QuerySettledBetsOfHeightResponse) MarshalToSizedBuffer

func (m *QuerySettledBetsOfHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySettledBetsOfHeightResponse) ProtoMessage

func (*QuerySettledBetsOfHeightResponse) ProtoMessage()

func (*QuerySettledBetsOfHeightResponse) Reset

func (*QuerySettledBetsOfHeightResponse) Size

func (m *QuerySettledBetsOfHeightResponse) Size() (n int)

func (*QuerySettledBetsOfHeightResponse) String

func (*QuerySettledBetsOfHeightResponse) Unmarshal

func (m *QuerySettledBetsOfHeightResponse) Unmarshal(dAtA []byte) error

func (*QuerySettledBetsOfHeightResponse) XXX_DiscardUnknown

func (m *QuerySettledBetsOfHeightResponse) XXX_DiscardUnknown()

func (*QuerySettledBetsOfHeightResponse) XXX_Marshal

func (m *QuerySettledBetsOfHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySettledBetsOfHeightResponse) XXX_Merge

func (*QuerySettledBetsOfHeightResponse) XXX_Size

func (m *QuerySettledBetsOfHeightResponse) XXX_Size() int

func (*QuerySettledBetsOfHeightResponse) XXX_Unmarshal

func (m *QuerySettledBetsOfHeightResponse) XXX_Unmarshal(b []byte) error

type SRKeeper

type SRKeeper interface {
	ProcessBetPlacement(ctx sdk.Context, betUID, bookUID, oddsUID string, maxLossMultiplier sdk.Dec, betAmount sdk.Int, payoutProfit sdk.Dec, bettorAddress sdk.AccAddress, betFee sdk.Int, oddsType OddsType, oddsVal string, betID uint64) ([]*BetFulfillment, error)
	RefundBettor(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount, payout sdk.Int, uniqueLock string) error
	BettorWins(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount, payout sdk.Int, uniqueLock string, fulfillment []*BetFulfillment, bookUID string) error
	BettorLoses(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount, payout sdk.Int, uniqueLock string, fulfillment []*BetFulfillment, bookUID string) error
	SetOrderBookAsSettled(ctx sdk.Context, orderBookUID string) error
}

SRKeeper defines the expected interface needed to process bet placement

type SettledBet

type SettledBet struct {
	// uid is the universal unique identifier for the bet.
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// bettor_address is the bech32 address of the bettor account.
	BettorAddress string `protobuf:"bytes,2,opt,name=bettor_address,json=bettorAddress,proto3" json:"bettor_address,omitempty"`
}

SettledBet is the type for a settled bet.

func NewSettledBet

func NewSettledBet(uid, bettorAddress string) *SettledBet

func (*SettledBet) Descriptor

func (*SettledBet) Descriptor() ([]byte, []int)

func (*SettledBet) GetBettorAddress

func (m *SettledBet) GetBettorAddress() string

func (*SettledBet) GetUID

func (m *SettledBet) GetUID() string

func (*SettledBet) Marshal

func (m *SettledBet) Marshal() (dAtA []byte, err error)

func (*SettledBet) MarshalTo

func (m *SettledBet) MarshalTo(dAtA []byte) (int, error)

func (*SettledBet) MarshalToSizedBuffer

func (m *SettledBet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SettledBet) ProtoMessage

func (*SettledBet) ProtoMessage()

func (*SettledBet) Reset

func (m *SettledBet) Reset()

func (*SettledBet) Size

func (m *SettledBet) Size() (n int)

func (*SettledBet) String

func (m *SettledBet) String() string

func (*SettledBet) Unmarshal

func (m *SettledBet) Unmarshal(dAtA []byte) error

func (*SettledBet) XXX_DiscardUnknown

func (m *SettledBet) XXX_DiscardUnknown()

func (*SettledBet) XXX_Marshal

func (m *SettledBet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SettledBet) XXX_Merge

func (m *SettledBet) XXX_Merge(src proto.Message)

func (*SettledBet) XXX_Size

func (m *SettledBet) XXX_Size() int

func (*SettledBet) XXX_Unmarshal

func (m *SettledBet) XXX_Unmarshal(b []byte) error

type UID2ID

type UID2ID struct {
	// uid is the universal unique identifier assigned to the bet.
	UID string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
	// id is an autogenerated sequential id for a bet.
	ID uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id"`
}

UID2ID is the type for mapping UIDs and Sequential IDs of bets.

func (*UID2ID) Descriptor

func (*UID2ID) Descriptor() ([]byte, []int)

func (*UID2ID) GetID

func (m *UID2ID) GetID() uint64

func (*UID2ID) GetUID

func (m *UID2ID) GetUID() string

func (*UID2ID) Marshal

func (m *UID2ID) Marshal() (dAtA []byte, err error)

func (*UID2ID) MarshalTo

func (m *UID2ID) MarshalTo(dAtA []byte) (int, error)

func (*UID2ID) MarshalToSizedBuffer

func (m *UID2ID) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UID2ID) ProtoMessage

func (*UID2ID) ProtoMessage()

func (*UID2ID) Reset

func (m *UID2ID) Reset()

func (*UID2ID) Size

func (m *UID2ID) Size() (n int)

func (*UID2ID) String

func (m *UID2ID) String() string

func (*UID2ID) Unmarshal

func (m *UID2ID) Unmarshal(dAtA []byte) error

func (*UID2ID) XXX_DiscardUnknown

func (m *UID2ID) XXX_DiscardUnknown()

func (*UID2ID) XXX_Marshal

func (m *UID2ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UID2ID) XXX_Merge

func (m *UID2ID) XXX_Merge(src proto.Message)

func (*UID2ID) XXX_Size

func (m *UID2ID) XXX_Size() int

func (*UID2ID) XXX_Unmarshal

func (m *UID2ID) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) PlaceBet

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Bet

func (*UnimplementedQueryServer) Bets

func (*UnimplementedQueryServer) BetsByCreator

func (*UnimplementedQueryServer) BetsByUIDs

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) PendingBets

func (*UnimplementedQueryServer) SettledBetsOfHeight

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL