Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type CurrencyPair
- func (cp CurrencyPair) Decimals() int
- func (*CurrencyPair) Descriptor() ([]byte, []int)
- func (m *CurrencyPair) GetBase() string
- func (m *CurrencyPair) GetQuote() string
- func (m *CurrencyPair) Marshal() (dAtA []byte, err error)
- func (m *CurrencyPair) MarshalTo(dAtA []byte) (int, error)
- func (m *CurrencyPair) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CurrencyPair) ProtoMessage()
- func (m *CurrencyPair) Reset()
- func (m *CurrencyPair) Size() (n int)
- func (m *CurrencyPair) String() string
- func (cp CurrencyPair) ToString() string
- func (m *CurrencyPair) Unmarshal(dAtA []byte) error
- func (cp CurrencyPair) ValidateBasic() error
- func (m *CurrencyPair) XXX_DiscardUnknown()
- func (m *CurrencyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CurrencyPair) XXX_Merge(src proto.Message)
- func (m *CurrencyPair) XXX_Size() int
- func (m *CurrencyPair) XXX_Unmarshal(b []byte) error
- type CurrencyPairAlreadyExistsError
- type CurrencyPairGenesis
- func (*CurrencyPairGenesis) Descriptor() ([]byte, []int)
- func (m *CurrencyPairGenesis) GetCurrencyPair() CurrencyPair
- func (m *CurrencyPairGenesis) GetCurrencyPairPrice() *QuotePrice
- func (m *CurrencyPairGenesis) GetId() uint64
- func (m *CurrencyPairGenesis) GetNonce() uint64
- func (m *CurrencyPairGenesis) Marshal() (dAtA []byte, err error)
- func (m *CurrencyPairGenesis) MarshalTo(dAtA []byte) (int, error)
- func (m *CurrencyPairGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CurrencyPairGenesis) ProtoMessage()
- func (m *CurrencyPairGenesis) Reset()
- func (m *CurrencyPairGenesis) Size() (n int)
- func (m *CurrencyPairGenesis) String() string
- func (m *CurrencyPairGenesis) Unmarshal(dAtA []byte) error
- func (cpg CurrencyPairGenesis) ValidateBasic() error
- func (m *CurrencyPairGenesis) XXX_DiscardUnknown()
- func (m *CurrencyPairGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CurrencyPairGenesis) XXX_Merge(src proto.Message)
- func (m *CurrencyPairGenesis) XXX_Size() int
- func (m *CurrencyPairGenesis) XXX_Unmarshal(b []byte) error
- type CurrencyPairNotExistError
- type CurrencyPairState
- func (*CurrencyPairState) Descriptor() ([]byte, []int)
- func (m *CurrencyPairState) GetId() uint64
- func (m *CurrencyPairState) GetNonce() uint64
- func (m *CurrencyPairState) GetPrice() *QuotePrice
- func (m *CurrencyPairState) Marshal() (dAtA []byte, err error)
- func (m *CurrencyPairState) MarshalTo(dAtA []byte) (int, error)
- func (m *CurrencyPairState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CurrencyPairState) ProtoMessage()
- func (m *CurrencyPairState) Reset()
- func (m *CurrencyPairState) Size() (n int)
- func (m *CurrencyPairState) String() string
- func (m *CurrencyPairState) Unmarshal(dAtA []byte) error
- func (cps CurrencyPairState) ValidateBasic() error
- func (m *CurrencyPairState) XXX_DiscardUnknown()
- func (m *CurrencyPairState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CurrencyPairState) XXX_Merge(src proto.Message)
- func (m *CurrencyPairState) XXX_Size() int
- func (m *CurrencyPairState) XXX_Unmarshal(b []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetCurrencyPairGenesis() []CurrencyPairGenesis
- func (m *GenesisState) GetNextId() uint64
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type GetAllCurrencyPairsRequest
- func (*GetAllCurrencyPairsRequest) Descriptor() ([]byte, []int)
- func (m *GetAllCurrencyPairsRequest) Marshal() (dAtA []byte, err error)
- func (m *GetAllCurrencyPairsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetAllCurrencyPairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetAllCurrencyPairsRequest) ProtoMessage()
- func (m *GetAllCurrencyPairsRequest) Reset()
- func (m *GetAllCurrencyPairsRequest) Size() (n int)
- func (m *GetAllCurrencyPairsRequest) String() string
- func (m *GetAllCurrencyPairsRequest) Unmarshal(dAtA []byte) error
- func (m *GetAllCurrencyPairsRequest) XXX_DiscardUnknown()
- func (m *GetAllCurrencyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetAllCurrencyPairsRequest) XXX_Merge(src proto.Message)
- func (m *GetAllCurrencyPairsRequest) XXX_Size() int
- func (m *GetAllCurrencyPairsRequest) XXX_Unmarshal(b []byte) error
- type GetAllCurrencyPairsResponse
- func (*GetAllCurrencyPairsResponse) Descriptor() ([]byte, []int)
- func (m *GetAllCurrencyPairsResponse) GetCurrencyPairs() []CurrencyPair
- func (m *GetAllCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
- func (m *GetAllCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetAllCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetAllCurrencyPairsResponse) ProtoMessage()
- func (m *GetAllCurrencyPairsResponse) Reset()
- func (m *GetAllCurrencyPairsResponse) Size() (n int)
- func (m *GetAllCurrencyPairsResponse) String() string
- func (m *GetAllCurrencyPairsResponse) Unmarshal(dAtA []byte) error
- func (m *GetAllCurrencyPairsResponse) XXX_DiscardUnknown()
- func (m *GetAllCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetAllCurrencyPairsResponse) XXX_Merge(src proto.Message)
- func (m *GetAllCurrencyPairsResponse) XXX_Size() int
- func (m *GetAllCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
- type GetPriceRequest
- func (*GetPriceRequest) Descriptor() ([]byte, []int)
- func (m *GetPriceRequest) GetCurrencyPair() *CurrencyPair
- func (m *GetPriceRequest) GetCurrencyPairId() string
- func (m *GetPriceRequest) GetCurrencyPairSelector() isGetPriceRequest_CurrencyPairSelector
- func (m *GetPriceRequest) Marshal() (dAtA []byte, err error)
- func (m *GetPriceRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetPriceRequest) ProtoMessage()
- func (m *GetPriceRequest) Reset()
- func (m *GetPriceRequest) Size() (n int)
- func (m *GetPriceRequest) String() string
- func (m *GetPriceRequest) Unmarshal(dAtA []byte) error
- func (m *GetPriceRequest) XXX_DiscardUnknown()
- func (m *GetPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetPriceRequest) XXX_Merge(src proto.Message)
- func (*GetPriceRequest) XXX_OneofWrappers() []interface{}
- func (m *GetPriceRequest) XXX_Size() int
- func (m *GetPriceRequest) XXX_Unmarshal(b []byte) error
- type GetPriceRequest_CurrencyPair
- type GetPriceRequest_CurrencyPairId
- type GetPriceResponse
- func (*GetPriceResponse) Descriptor() ([]byte, []int)
- func (m *GetPriceResponse) GetDecimals() uint64
- func (m *GetPriceResponse) GetId() uint64
- func (m *GetPriceResponse) GetNonce() uint64
- func (m *GetPriceResponse) GetPrice() *QuotePrice
- func (m *GetPriceResponse) Marshal() (dAtA []byte, err error)
- func (m *GetPriceResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetPriceResponse) ProtoMessage()
- func (m *GetPriceResponse) Reset()
- func (m *GetPriceResponse) Size() (n int)
- func (m *GetPriceResponse) String() string
- func (m *GetPriceResponse) Unmarshal(dAtA []byte) error
- func (m *GetPriceResponse) XXX_DiscardUnknown()
- func (m *GetPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetPriceResponse) XXX_Merge(src proto.Message)
- func (m *GetPriceResponse) XXX_Size() int
- func (m *GetPriceResponse) XXX_Unmarshal(b []byte) error
- type MsgAddCurrencyPairs
- func (*MsgAddCurrencyPairs) Descriptor() ([]byte, []int)
- func (m *MsgAddCurrencyPairs) GetAuthority() string
- func (m *MsgAddCurrencyPairs) GetCurrencyPairs() []CurrencyPair
- func (m MsgAddCurrencyPairs) GetSigners() []sdk.AccAddress
- func (m *MsgAddCurrencyPairs) Marshal() (dAtA []byte, err error)
- func (m *MsgAddCurrencyPairs) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAddCurrencyPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAddCurrencyPairs) ProtoMessage()
- func (m *MsgAddCurrencyPairs) Reset()
- func (m *MsgAddCurrencyPairs) Size() (n int)
- func (m *MsgAddCurrencyPairs) String() string
- func (m *MsgAddCurrencyPairs) Unmarshal(dAtA []byte) error
- func (m MsgAddCurrencyPairs) ValidateBasic() error
- func (m *MsgAddCurrencyPairs) XXX_DiscardUnknown()
- func (m *MsgAddCurrencyPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAddCurrencyPairs) XXX_Merge(src proto.Message)
- func (m *MsgAddCurrencyPairs) XXX_Size() int
- func (m *MsgAddCurrencyPairs) XXX_Unmarshal(b []byte) error
- type MsgAddCurrencyPairsResponse
- func (*MsgAddCurrencyPairsResponse) Descriptor() ([]byte, []int)
- func (m *MsgAddCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgAddCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAddCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAddCurrencyPairsResponse) ProtoMessage()
- func (m *MsgAddCurrencyPairsResponse) Reset()
- func (m *MsgAddCurrencyPairsResponse) Size() (n int)
- func (m *MsgAddCurrencyPairsResponse) String() string
- func (m *MsgAddCurrencyPairsResponse) Unmarshal(dAtA []byte) error
- func (m *MsgAddCurrencyPairsResponse) XXX_DiscardUnknown()
- func (m *MsgAddCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAddCurrencyPairsResponse) XXX_Merge(src proto.Message)
- func (m *MsgAddCurrencyPairsResponse) XXX_Size() int
- func (m *MsgAddCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgRemoveCurrencyPairs
- func (*MsgRemoveCurrencyPairs) Descriptor() ([]byte, []int)
- func (m *MsgRemoveCurrencyPairs) GetAuthority() string
- func (m *MsgRemoveCurrencyPairs) GetCurrencyPairIds() []string
- func (m MsgRemoveCurrencyPairs) GetSigners() []sdk.AccAddress
- func (m *MsgRemoveCurrencyPairs) Marshal() (dAtA []byte, err error)
- func (m *MsgRemoveCurrencyPairs) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgRemoveCurrencyPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgRemoveCurrencyPairs) ProtoMessage()
- func (m *MsgRemoveCurrencyPairs) Reset()
- func (m *MsgRemoveCurrencyPairs) Size() (n int)
- func (m *MsgRemoveCurrencyPairs) String() string
- func (m *MsgRemoveCurrencyPairs) Unmarshal(dAtA []byte) error
- func (m MsgRemoveCurrencyPairs) ValidateBasic() error
- func (m *MsgRemoveCurrencyPairs) XXX_DiscardUnknown()
- func (m *MsgRemoveCurrencyPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgRemoveCurrencyPairs) XXX_Merge(src proto.Message)
- func (m *MsgRemoveCurrencyPairs) XXX_Size() int
- func (m *MsgRemoveCurrencyPairs) XXX_Unmarshal(b []byte) error
- type MsgRemoveCurrencyPairsResponse
- func (*MsgRemoveCurrencyPairsResponse) Descriptor() ([]byte, []int)
- func (m *MsgRemoveCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgRemoveCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgRemoveCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgRemoveCurrencyPairsResponse) ProtoMessage()
- func (m *MsgRemoveCurrencyPairsResponse) Reset()
- func (m *MsgRemoveCurrencyPairsResponse) Size() (n int)
- func (m *MsgRemoveCurrencyPairsResponse) String() string
- func (m *MsgRemoveCurrencyPairsResponse) Unmarshal(dAtA []byte) error
- func (m *MsgRemoveCurrencyPairsResponse) XXX_DiscardUnknown()
- func (m *MsgRemoveCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgRemoveCurrencyPairsResponse) XXX_Merge(src proto.Message)
- func (m *MsgRemoveCurrencyPairsResponse) XXX_Size() int
- func (m *MsgRemoveCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type QueryClient
- type QueryServer
- type QuotePrice
- func (*QuotePrice) Descriptor() ([]byte, []int)
- func (m *QuotePrice) GetBlockHeight() uint64
- func (m *QuotePrice) GetBlockTimestamp() time.Time
- func (m *QuotePrice) Marshal() (dAtA []byte, err error)
- func (m *QuotePrice) MarshalTo(dAtA []byte) (int, error)
- func (m *QuotePrice) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QuotePrice) ProtoMessage()
- func (m *QuotePrice) Reset()
- func (m *QuotePrice) Size() (n int)
- func (m *QuotePrice) String() string
- func (m *QuotePrice) Unmarshal(dAtA []byte) error
- func (qp QuotePrice) ValidateBasic() error
- func (m *QuotePrice) XXX_DiscardUnknown()
- func (m *QuotePrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QuotePrice) XXX_Merge(src proto.Message)
- func (m *QuotePrice) XXX_Size() int
- func (m *QuotePrice) XXX_Unmarshal(b []byte) error
- type QuotePriceNotExistError
- type QuotePriceWithNonce
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( // Name of module for external use ModuleName = "oracle" // Top level store key for the oracle module StoreKey = ModuleName )
Variables ¶
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( // CurrencyPairKeyPrefix is the key-prefix under which currency-pair state is stored CurrencyPairKeyPrefix = collections.NewPrefix(0) // CurrencyPairIDKeyPrefix is the key-prefix under which the next currency-pairID is stored CurrencyPairIDKeyPrefix = collections.NewPrefix(1) // UniqueIndexCurrencyPairKeyPrefix is the key-prifix under which the unique index on // currency-pairs is stored UniqueIndexCurrencyPairKeyPrefix = collections.NewPrefix(2) // IDIndexCurrencyPairKeyPrefix IDIndexCurrencyPairKeyPrefix = collections.NewPrefix(3) )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
RegisterInterfaces registers the x/oracle messages + message service w/ the InterfaceRegistry (registry).
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary x/oracle interfaces (messages) on the cdc. These types are used for amino serialization
func RegisterMsgServer ¶
func RegisterQueryHandler ¶
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)
Types ¶
type CurrencyPair ¶
type CurrencyPair struct { Base string `protobuf:"bytes,1,opt,name=Base,proto3" json:"Base,omitempty"` Quote string `protobuf:"bytes,2,opt,name=Quote,proto3" json:"Quote,omitempty"` }
CurrencyPair is the standard representation of a pair of assets, where one (Base) is priced in terms of the other (Quote)
func CurrencyPairFromString ¶
func CurrencyPairFromString(s string) (CurrencyPair, error)
func NewCurrencyPair ¶
func NewCurrencyPair(base, quote string) CurrencyPair
NewCurrencyPair returns a new CurrencyPair with the given base and quote strings.
func (CurrencyPair) Decimals ¶
func (cp CurrencyPair) Decimals() int
Decimals returns the number of decimals that the quote will be reported to. If the quote is Ethereum, then the number of decimals is 18. Otherwise, the decimals will be reorted to 8.
func (*CurrencyPair) Descriptor ¶
func (*CurrencyPair) Descriptor() ([]byte, []int)
func (*CurrencyPair) GetBase ¶
func (m *CurrencyPair) GetBase() string
func (*CurrencyPair) GetQuote ¶
func (m *CurrencyPair) GetQuote() string
func (*CurrencyPair) Marshal ¶
func (m *CurrencyPair) Marshal() (dAtA []byte, err error)
func (*CurrencyPair) MarshalToSizedBuffer ¶
func (m *CurrencyPair) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CurrencyPair) ProtoMessage ¶
func (*CurrencyPair) ProtoMessage()
func (*CurrencyPair) Reset ¶
func (m *CurrencyPair) Reset()
func (*CurrencyPair) Size ¶
func (m *CurrencyPair) Size() (n int)
func (*CurrencyPair) String ¶
func (m *CurrencyPair) String() string
func (CurrencyPair) ToString ¶
func (cp CurrencyPair) ToString() string
ToString returns a string representation of the CurrencyPair, in the following form "ETH/BTC".
NOTICE: prefer ToString over the default String method, as the ToString method is used for marshalling currency-pairs into vote-extensions.
func (*CurrencyPair) Unmarshal ¶
func (m *CurrencyPair) Unmarshal(dAtA []byte) error
func (CurrencyPair) ValidateBasic ¶
func (cp CurrencyPair) ValidateBasic() error
ValidateBasic checks that the Base / Quote strings in the CurrencyPair are formatted correctly, i.e Base + Quote are non-empty, and are in upper-case.
func (*CurrencyPair) XXX_DiscardUnknown ¶
func (m *CurrencyPair) XXX_DiscardUnknown()
func (*CurrencyPair) XXX_Marshal ¶
func (m *CurrencyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CurrencyPair) XXX_Merge ¶
func (m *CurrencyPair) XXX_Merge(src proto.Message)
func (*CurrencyPair) XXX_Size ¶
func (m *CurrencyPair) XXX_Size() int
func (*CurrencyPair) XXX_Unmarshal ¶
func (m *CurrencyPair) XXX_Unmarshal(b []byte) error
type CurrencyPairAlreadyExistsError ¶
type CurrencyPairAlreadyExistsError struct {
// contains filtered or unexported fields
}
func NewCurrencyPairAlreadyExistsError ¶
func NewCurrencyPairAlreadyExistsError(cp CurrencyPair) CurrencyPairAlreadyExistsError
func (CurrencyPairAlreadyExistsError) Error ¶
func (e CurrencyPairAlreadyExistsError) Error() string
type CurrencyPairGenesis ¶
type CurrencyPairGenesis struct { // The CurrencyPair to be added to module state CurrencyPair CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` // A genesis price if one exists (note this will be empty, unless it results // from forking the state of this module) CurrencyPairPrice *QuotePrice `protobuf:"bytes,2,opt,name=currency_pair_price,json=currencyPairPrice,proto3" json:"currency_pair_price,omitempty"` // nonce is the nonce (number of updates) for the CP (same case as above, // likely 0 unless it results from fork of module) Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` // id is the ID of the CurrencyPair Id uint64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` }
CurrencyPairGenesis is the information necessary for initialization of a CurrencyPair.
func (*CurrencyPairGenesis) Descriptor ¶
func (*CurrencyPairGenesis) Descriptor() ([]byte, []int)
func (*CurrencyPairGenesis) GetCurrencyPair ¶
func (m *CurrencyPairGenesis) GetCurrencyPair() CurrencyPair
func (*CurrencyPairGenesis) GetCurrencyPairPrice ¶
func (m *CurrencyPairGenesis) GetCurrencyPairPrice() *QuotePrice
func (*CurrencyPairGenesis) GetId ¶
func (m *CurrencyPairGenesis) GetId() uint64
func (*CurrencyPairGenesis) GetNonce ¶
func (m *CurrencyPairGenesis) GetNonce() uint64
func (*CurrencyPairGenesis) Marshal ¶
func (m *CurrencyPairGenesis) Marshal() (dAtA []byte, err error)
func (*CurrencyPairGenesis) MarshalTo ¶
func (m *CurrencyPairGenesis) MarshalTo(dAtA []byte) (int, error)
func (*CurrencyPairGenesis) MarshalToSizedBuffer ¶
func (m *CurrencyPairGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CurrencyPairGenesis) ProtoMessage ¶
func (*CurrencyPairGenesis) ProtoMessage()
func (*CurrencyPairGenesis) Reset ¶
func (m *CurrencyPairGenesis) Reset()
func (*CurrencyPairGenesis) Size ¶
func (m *CurrencyPairGenesis) Size() (n int)
func (*CurrencyPairGenesis) String ¶
func (m *CurrencyPairGenesis) String() string
func (*CurrencyPairGenesis) Unmarshal ¶
func (m *CurrencyPairGenesis) Unmarshal(dAtA []byte) error
func (CurrencyPairGenesis) ValidateBasic ¶
func (cpg CurrencyPairGenesis) ValidateBasic() error
ValidateBasic validates that the CurrencyPair is valid, and performs any necessary validation on the genesis QuotePrice for the CurrencyPair. This fails if the CurrencyPair is invalid, or if the QuotePrice is nil, but the Nonce is non-nil.
func (*CurrencyPairGenesis) XXX_DiscardUnknown ¶
func (m *CurrencyPairGenesis) XXX_DiscardUnknown()
func (*CurrencyPairGenesis) XXX_Marshal ¶
func (m *CurrencyPairGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CurrencyPairGenesis) XXX_Merge ¶
func (m *CurrencyPairGenesis) XXX_Merge(src proto.Message)
func (*CurrencyPairGenesis) XXX_Size ¶
func (m *CurrencyPairGenesis) XXX_Size() int
func (*CurrencyPairGenesis) XXX_Unmarshal ¶
func (m *CurrencyPairGenesis) XXX_Unmarshal(b []byte) error
type CurrencyPairNotExistError ¶
type CurrencyPairNotExistError struct {
// contains filtered or unexported fields
}
func NewCurrencyPairNotExistError ¶
func NewCurrencyPairNotExistError(cp CurrencyPair) CurrencyPairNotExistError
func (CurrencyPairNotExistError) Error ¶
func (e CurrencyPairNotExistError) Error() string
type CurrencyPairState ¶
type CurrencyPairState struct { // QuotePrice is the latest price for a currency-pair, notice this value can be null in the case that no price exists for the currency-pair Price *QuotePrice `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` // Nonce is the number of updates this currency-pair has received Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // ID is the ID of the CurrencyPair Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` }
CurrencyPairState represents the stateful information tracked by the x/oracle module per-currency-pair.
func NewCurrencyPairState ¶
func NewCurrencyPairState(id uint64, nonce uint64, quotePrice *QuotePrice) CurrencyPairState
NewCurrencyPairState returns a new CurrencyPairState given an Id, nonce, and QuotePrice.
func (*CurrencyPairState) Descriptor ¶
func (*CurrencyPairState) Descriptor() ([]byte, []int)
func (*CurrencyPairState) GetId ¶
func (m *CurrencyPairState) GetId() uint64
func (*CurrencyPairState) GetNonce ¶
func (m *CurrencyPairState) GetNonce() uint64
func (*CurrencyPairState) GetPrice ¶
func (m *CurrencyPairState) GetPrice() *QuotePrice
func (*CurrencyPairState) Marshal ¶
func (m *CurrencyPairState) Marshal() (dAtA []byte, err error)
func (*CurrencyPairState) MarshalTo ¶
func (m *CurrencyPairState) MarshalTo(dAtA []byte) (int, error)
func (*CurrencyPairState) MarshalToSizedBuffer ¶
func (m *CurrencyPairState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CurrencyPairState) ProtoMessage ¶
func (*CurrencyPairState) ProtoMessage()
func (*CurrencyPairState) Reset ¶
func (m *CurrencyPairState) Reset()
func (*CurrencyPairState) Size ¶
func (m *CurrencyPairState) Size() (n int)
func (*CurrencyPairState) String ¶
func (m *CurrencyPairState) String() string
func (*CurrencyPairState) Unmarshal ¶
func (m *CurrencyPairState) Unmarshal(dAtA []byte) error
func (CurrencyPairState) ValidateBasic ¶
func (cps CurrencyPairState) ValidateBasic() error
ValidateBasic checks that the CurrencyPairState is valid, i.e the nonce is zero if the QuotePrice is nil, and non-zero otherwise.
func (*CurrencyPairState) XXX_DiscardUnknown ¶
func (m *CurrencyPairState) XXX_DiscardUnknown()
func (*CurrencyPairState) XXX_Marshal ¶
func (m *CurrencyPairState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CurrencyPairState) XXX_Merge ¶
func (m *CurrencyPairState) XXX_Merge(src proto.Message)
func (*CurrencyPairState) XXX_Size ¶
func (m *CurrencyPairState) XXX_Size() int
func (*CurrencyPairState) XXX_Unmarshal ¶
func (m *CurrencyPairState) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct { // CurrencyPairGenesis is the set of CurrencyPairGeneses for the module. I.e // the starting set of CurrencyPairs for the module + information regarding their // latest update. CurrencyPairGenesis []CurrencyPairGenesis `protobuf:"bytes,1,rep,name=currency_pair_genesis,json=currencyPairGenesis,proto3" json:"currency_pair_genesis"` // NextID is the next ID to be used for a CurrencyPair NextId uint64 `protobuf:"varint,2,opt,name=next_id,json=nextId,proto3" json:"next_id,omitempty"` }
GenesisState is the genesis-state for the x/oracle module, it takes a set of predefined CurrencyPairGeneses
func DefaultGenesisState ¶
func DefaultGenesisState() *GenesisState
DefaultGenesisState returns a default genesis state for the oracle module
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns x/oracle GenesisState given raw application genesis state.
func NewGenesisState ¶
func NewGenesisState(cpgs []CurrencyPairGenesis, nextID uint64) *GenesisState
NewGenesisState returns a new genesis-state from a set of CurrencyPairGeneses
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetCurrencyPairGenesis ¶
func (m *GenesisState) GetCurrencyPairGenesis() []CurrencyPairGenesis
func (*GenesisState) GetNextId ¶
func (m *GenesisState) GetNextId() uint64
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err 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 validates the currency-pair geneses that the Genesis-State is composed of valid CurrencyPairGeneses, and that no ID for a currency-pair is repeated.
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 GetAllCurrencyPairsRequest ¶
type GetAllCurrencyPairsRequest struct { }
func (*GetAllCurrencyPairsRequest) Descriptor ¶
func (*GetAllCurrencyPairsRequest) Descriptor() ([]byte, []int)
func (*GetAllCurrencyPairsRequest) Marshal ¶
func (m *GetAllCurrencyPairsRequest) Marshal() (dAtA []byte, err error)
func (*GetAllCurrencyPairsRequest) MarshalTo ¶
func (m *GetAllCurrencyPairsRequest) MarshalTo(dAtA []byte) (int, error)
func (*GetAllCurrencyPairsRequest) MarshalToSizedBuffer ¶
func (m *GetAllCurrencyPairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetAllCurrencyPairsRequest) ProtoMessage ¶
func (*GetAllCurrencyPairsRequest) ProtoMessage()
func (*GetAllCurrencyPairsRequest) Reset ¶
func (m *GetAllCurrencyPairsRequest) Reset()
func (*GetAllCurrencyPairsRequest) Size ¶
func (m *GetAllCurrencyPairsRequest) Size() (n int)
func (*GetAllCurrencyPairsRequest) String ¶
func (m *GetAllCurrencyPairsRequest) String() string
func (*GetAllCurrencyPairsRequest) Unmarshal ¶
func (m *GetAllCurrencyPairsRequest) Unmarshal(dAtA []byte) error
func (*GetAllCurrencyPairsRequest) XXX_DiscardUnknown ¶
func (m *GetAllCurrencyPairsRequest) XXX_DiscardUnknown()
func (*GetAllCurrencyPairsRequest) XXX_Marshal ¶
func (m *GetAllCurrencyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetAllCurrencyPairsRequest) XXX_Merge ¶
func (m *GetAllCurrencyPairsRequest) XXX_Merge(src proto.Message)
func (*GetAllCurrencyPairsRequest) XXX_Size ¶
func (m *GetAllCurrencyPairsRequest) XXX_Size() int
func (*GetAllCurrencyPairsRequest) XXX_Unmarshal ¶
func (m *GetAllCurrencyPairsRequest) XXX_Unmarshal(b []byte) error
type GetAllCurrencyPairsResponse ¶
type GetAllCurrencyPairsResponse struct {
CurrencyPairs []CurrencyPair `protobuf:"bytes,1,rep,name=currency_pairs,json=currencyPairs,proto3" json:"currency_pairs"`
}
GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is currently tracking
func (*GetAllCurrencyPairsResponse) Descriptor ¶
func (*GetAllCurrencyPairsResponse) Descriptor() ([]byte, []int)
func (*GetAllCurrencyPairsResponse) GetCurrencyPairs ¶
func (m *GetAllCurrencyPairsResponse) GetCurrencyPairs() []CurrencyPair
func (*GetAllCurrencyPairsResponse) Marshal ¶
func (m *GetAllCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
func (*GetAllCurrencyPairsResponse) MarshalTo ¶
func (m *GetAllCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
func (*GetAllCurrencyPairsResponse) MarshalToSizedBuffer ¶
func (m *GetAllCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetAllCurrencyPairsResponse) ProtoMessage ¶
func (*GetAllCurrencyPairsResponse) ProtoMessage()
func (*GetAllCurrencyPairsResponse) Reset ¶
func (m *GetAllCurrencyPairsResponse) Reset()
func (*GetAllCurrencyPairsResponse) Size ¶
func (m *GetAllCurrencyPairsResponse) Size() (n int)
func (*GetAllCurrencyPairsResponse) String ¶
func (m *GetAllCurrencyPairsResponse) String() string
func (*GetAllCurrencyPairsResponse) Unmarshal ¶
func (m *GetAllCurrencyPairsResponse) Unmarshal(dAtA []byte) error
func (*GetAllCurrencyPairsResponse) XXX_DiscardUnknown ¶
func (m *GetAllCurrencyPairsResponse) XXX_DiscardUnknown()
func (*GetAllCurrencyPairsResponse) XXX_Marshal ¶
func (m *GetAllCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetAllCurrencyPairsResponse) XXX_Merge ¶
func (m *GetAllCurrencyPairsResponse) XXX_Merge(src proto.Message)
func (*GetAllCurrencyPairsResponse) XXX_Size ¶
func (m *GetAllCurrencyPairsResponse) XXX_Size() int
func (*GetAllCurrencyPairsResponse) XXX_Unmarshal ¶
func (m *GetAllCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
type GetPriceRequest ¶
type GetPriceRequest struct { // CurrencyPairSelector represents the types that the user may provide to the // request to identify a CurrencyPair // // Types that are valid to be assigned to CurrencyPairSelector: // *GetPriceRequest_CurrencyPair // *GetPriceRequest_CurrencyPairId CurrencyPairSelector isGetPriceRequest_CurrencyPairSelector `protobuf_oneof:"currency_pair_selector"` }
GetPriceRequest either takes a CurrencyPair, or an identifier for the CurrencyPair in the format base/quote
func (*GetPriceRequest) Descriptor ¶
func (*GetPriceRequest) Descriptor() ([]byte, []int)
func (*GetPriceRequest) GetCurrencyPair ¶
func (m *GetPriceRequest) GetCurrencyPair() *CurrencyPair
func (*GetPriceRequest) GetCurrencyPairId ¶
func (m *GetPriceRequest) GetCurrencyPairId() string
func (*GetPriceRequest) GetCurrencyPairSelector ¶
func (m *GetPriceRequest) GetCurrencyPairSelector() isGetPriceRequest_CurrencyPairSelector
func (*GetPriceRequest) Marshal ¶
func (m *GetPriceRequest) Marshal() (dAtA []byte, err error)
func (*GetPriceRequest) MarshalToSizedBuffer ¶
func (m *GetPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetPriceRequest) ProtoMessage ¶
func (*GetPriceRequest) ProtoMessage()
func (*GetPriceRequest) Reset ¶
func (m *GetPriceRequest) Reset()
func (*GetPriceRequest) Size ¶
func (m *GetPriceRequest) Size() (n int)
func (*GetPriceRequest) String ¶
func (m *GetPriceRequest) String() string
func (*GetPriceRequest) Unmarshal ¶
func (m *GetPriceRequest) Unmarshal(dAtA []byte) error
func (*GetPriceRequest) XXX_DiscardUnknown ¶
func (m *GetPriceRequest) XXX_DiscardUnknown()
func (*GetPriceRequest) XXX_Marshal ¶
func (m *GetPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetPriceRequest) XXX_Merge ¶
func (m *GetPriceRequest) XXX_Merge(src proto.Message)
func (*GetPriceRequest) XXX_OneofWrappers ¶
func (*GetPriceRequest) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*GetPriceRequest) XXX_Size ¶
func (m *GetPriceRequest) XXX_Size() int
func (*GetPriceRequest) XXX_Unmarshal ¶
func (m *GetPriceRequest) XXX_Unmarshal(b []byte) error
type GetPriceRequest_CurrencyPair ¶
type GetPriceRequest_CurrencyPair struct {
CurrencyPair *CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3,oneof" json:"currency_pair,omitempty"`
}
func (*GetPriceRequest_CurrencyPair) MarshalTo ¶
func (m *GetPriceRequest_CurrencyPair) MarshalTo(dAtA []byte) (int, error)
func (*GetPriceRequest_CurrencyPair) MarshalToSizedBuffer ¶
func (m *GetPriceRequest_CurrencyPair) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetPriceRequest_CurrencyPair) Size ¶
func (m *GetPriceRequest_CurrencyPair) Size() (n int)
type GetPriceRequest_CurrencyPairId ¶
type GetPriceRequest_CurrencyPairId struct {
CurrencyPairId string `protobuf:"bytes,2,opt,name=currency_pair_id,json=currencyPairId,proto3,oneof" json:"currency_pair_id,omitempty"`
}
func (*GetPriceRequest_CurrencyPairId) MarshalTo ¶
func (m *GetPriceRequest_CurrencyPairId) MarshalTo(dAtA []byte) (int, error)
func (*GetPriceRequest_CurrencyPairId) MarshalToSizedBuffer ¶
func (m *GetPriceRequest_CurrencyPairId) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetPriceRequest_CurrencyPairId) Size ¶
func (m *GetPriceRequest_CurrencyPairId) Size() (n int)
type GetPriceResponse ¶
type GetPriceResponse struct { // QuotePrice represents the quote-price for the CurrencyPair given in // GetPriceRequest (possibly nil if no update has been made) Price *QuotePrice `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` // nonce represents the nonce for the CurrencyPair if it exists in state Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // decimals represents the number of decimals that the quote-price is // represented in. For Pairs where ETHEREUM is the quote this will be 18, // otherwise it will be 8. Decimals uint64 `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"` // ID represents the identifier for the CurrencyPair. Id uint64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` }
GetPriceResponse is the response from the GetPrice grpc method exposed from the x/oracle query service
func (*GetPriceResponse) Descriptor ¶
func (*GetPriceResponse) Descriptor() ([]byte, []int)
func (*GetPriceResponse) GetDecimals ¶
func (m *GetPriceResponse) GetDecimals() uint64
func (*GetPriceResponse) GetId ¶
func (m *GetPriceResponse) GetId() uint64
func (*GetPriceResponse) GetNonce ¶
func (m *GetPriceResponse) GetNonce() uint64
func (*GetPriceResponse) GetPrice ¶
func (m *GetPriceResponse) GetPrice() *QuotePrice
func (*GetPriceResponse) Marshal ¶
func (m *GetPriceResponse) Marshal() (dAtA []byte, err error)
func (*GetPriceResponse) MarshalToSizedBuffer ¶
func (m *GetPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetPriceResponse) ProtoMessage ¶
func (*GetPriceResponse) ProtoMessage()
func (*GetPriceResponse) Reset ¶
func (m *GetPriceResponse) Reset()
func (*GetPriceResponse) Size ¶
func (m *GetPriceResponse) Size() (n int)
func (*GetPriceResponse) String ¶
func (m *GetPriceResponse) String() string
func (*GetPriceResponse) Unmarshal ¶
func (m *GetPriceResponse) Unmarshal(dAtA []byte) error
func (*GetPriceResponse) XXX_DiscardUnknown ¶
func (m *GetPriceResponse) XXX_DiscardUnknown()
func (*GetPriceResponse) XXX_Marshal ¶
func (m *GetPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetPriceResponse) XXX_Merge ¶
func (m *GetPriceResponse) XXX_Merge(src proto.Message)
func (*GetPriceResponse) XXX_Size ¶
func (m *GetPriceResponse) XXX_Size() int
func (*GetPriceResponse) XXX_Unmarshal ¶
func (m *GetPriceResponse) XXX_Unmarshal(b []byte) error
type MsgAddCurrencyPairs ¶
type MsgAddCurrencyPairs struct { // authority is the address of the account that is authorized to update the // x/oracle's CurrencyPairs Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // set of CurrencyPairs to be added to the module (+ prices if they are to be // set) CurrencyPairs []CurrencyPair `protobuf:"bytes,2,rep,name=currency_pairs,json=currencyPairs,proto3" json:"currency_pairs"` }
Given an authority + a set of CurrencyPairs, the x/oracle module will check to see that the authority has permissions to update the set of CurrencyPairs tracked in the oracle, and add the given CurrencyPairs to be tracked in each VoteExtension
func NewMsgAddCurrencyPairs ¶
func NewMsgAddCurrencyPairs(authority string, cps []CurrencyPair) MsgAddCurrencyPairs
NewMsgAddCurrencyPairs returns a new message from a set of currency-pairs and an authority
func (*MsgAddCurrencyPairs) Descriptor ¶
func (*MsgAddCurrencyPairs) Descriptor() ([]byte, []int)
func (*MsgAddCurrencyPairs) GetAuthority ¶
func (m *MsgAddCurrencyPairs) GetAuthority() string
func (*MsgAddCurrencyPairs) GetCurrencyPairs ¶
func (m *MsgAddCurrencyPairs) GetCurrencyPairs() []CurrencyPair
func (MsgAddCurrencyPairs) GetSigners ¶
func (m MsgAddCurrencyPairs) GetSigners() []sdk.AccAddress
GetSigners, get the addresses that must sign this message. In this case, the signer must be the module authority.
func (*MsgAddCurrencyPairs) Marshal ¶
func (m *MsgAddCurrencyPairs) Marshal() (dAtA []byte, err error)
func (*MsgAddCurrencyPairs) MarshalTo ¶
func (m *MsgAddCurrencyPairs) MarshalTo(dAtA []byte) (int, error)
func (*MsgAddCurrencyPairs) MarshalToSizedBuffer ¶
func (m *MsgAddCurrencyPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgAddCurrencyPairs) ProtoMessage ¶
func (*MsgAddCurrencyPairs) ProtoMessage()
func (*MsgAddCurrencyPairs) Reset ¶
func (m *MsgAddCurrencyPairs) Reset()
func (*MsgAddCurrencyPairs) Size ¶
func (m *MsgAddCurrencyPairs) Size() (n int)
func (*MsgAddCurrencyPairs) String ¶
func (m *MsgAddCurrencyPairs) String() string
func (*MsgAddCurrencyPairs) Unmarshal ¶
func (m *MsgAddCurrencyPairs) Unmarshal(dAtA []byte) error
func (MsgAddCurrencyPairs) ValidateBasic ¶
func (m MsgAddCurrencyPairs) ValidateBasic() error
ValidateBasic determines whether or not the information in the message is formatted correctly, specifically whether the authority is a valid acc-address, and that each CurrencyPair in the message is formatted correctly
func (*MsgAddCurrencyPairs) XXX_DiscardUnknown ¶
func (m *MsgAddCurrencyPairs) XXX_DiscardUnknown()
func (*MsgAddCurrencyPairs) XXX_Marshal ¶
func (m *MsgAddCurrencyPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgAddCurrencyPairs) XXX_Merge ¶
func (m *MsgAddCurrencyPairs) XXX_Merge(src proto.Message)
func (*MsgAddCurrencyPairs) XXX_Size ¶
func (m *MsgAddCurrencyPairs) XXX_Size() int
func (*MsgAddCurrencyPairs) XXX_Unmarshal ¶
func (m *MsgAddCurrencyPairs) XXX_Unmarshal(b []byte) error
type MsgAddCurrencyPairsResponse ¶
type MsgAddCurrencyPairsResponse struct { }
func (*MsgAddCurrencyPairsResponse) Descriptor ¶
func (*MsgAddCurrencyPairsResponse) Descriptor() ([]byte, []int)
func (*MsgAddCurrencyPairsResponse) Marshal ¶
func (m *MsgAddCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
func (*MsgAddCurrencyPairsResponse) MarshalTo ¶
func (m *MsgAddCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgAddCurrencyPairsResponse) MarshalToSizedBuffer ¶
func (m *MsgAddCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgAddCurrencyPairsResponse) ProtoMessage ¶
func (*MsgAddCurrencyPairsResponse) ProtoMessage()
func (*MsgAddCurrencyPairsResponse) Reset ¶
func (m *MsgAddCurrencyPairsResponse) Reset()
func (*MsgAddCurrencyPairsResponse) Size ¶
func (m *MsgAddCurrencyPairsResponse) Size() (n int)
func (*MsgAddCurrencyPairsResponse) String ¶
func (m *MsgAddCurrencyPairsResponse) String() string
func (*MsgAddCurrencyPairsResponse) Unmarshal ¶
func (m *MsgAddCurrencyPairsResponse) Unmarshal(dAtA []byte) error
func (*MsgAddCurrencyPairsResponse) XXX_DiscardUnknown ¶
func (m *MsgAddCurrencyPairsResponse) XXX_DiscardUnknown()
func (*MsgAddCurrencyPairsResponse) XXX_Marshal ¶
func (m *MsgAddCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgAddCurrencyPairsResponse) XXX_Merge ¶
func (m *MsgAddCurrencyPairsResponse) XXX_Merge(src proto.Message)
func (*MsgAddCurrencyPairsResponse) XXX_Size ¶
func (m *MsgAddCurrencyPairsResponse) XXX_Size() int
func (*MsgAddCurrencyPairsResponse) XXX_Unmarshal ¶
func (m *MsgAddCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { // AddCurrencyPairs will be used only by governance to update the set of // available CurrencyPairs. Given a set of CurrencyPair objects, update // the available currency pairs in the module . AddCurrencyPairs(ctx context.Context, in *MsgAddCurrencyPairs, opts ...grpc.CallOption) (*MsgAddCurrencyPairsResponse, error) // RemoveCurrencyPairs will be used explicitly by governance to remove the // given set of currency-pairs from the module's state. Thus these // CurrencyPairs will no longer have price-data available from this module. RemoveCurrencyPairs(ctx context.Context, in *MsgRemoveCurrencyPairs, opts ...grpc.CallOption) (*MsgRemoveCurrencyPairsResponse, 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 MsgRemoveCurrencyPairs ¶
type MsgRemoveCurrencyPairs struct { // authority is the address of the account that is authorized to update the // x/oracle's CurrencyPairs Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // currency_pair_ids are the stringified representation of a currency-pairs // (base/quote) to be removed from the module's state CurrencyPairIds []string `protobuf:"bytes,2,rep,name=currency_pair_ids,json=currencyPairIds,proto3" json:"currency_pair_ids,omitempty"` }
Given an authority + a set of CurrencyPairIDs, the x/oracle module's message service will remove all of the CurrencyPairs identified by each CurrencyPairID in the request from state. Notice, if a given currency-pair does not exist in state, the module ignores that currency-pair and continues removing the rest.
func NewMsgRemoveCurrencyPairs ¶
func NewMsgRemoveCurrencyPairs(authority string, currencyPairIds []string) MsgRemoveCurrencyPairs
NewMsgRemoveCurrencyPairs returns a new message to remove a set of currency-pairs from the x/oracle module's state
func (*MsgRemoveCurrencyPairs) Descriptor ¶
func (*MsgRemoveCurrencyPairs) Descriptor() ([]byte, []int)
func (*MsgRemoveCurrencyPairs) GetAuthority ¶
func (m *MsgRemoveCurrencyPairs) GetAuthority() string
func (*MsgRemoveCurrencyPairs) GetCurrencyPairIds ¶
func (m *MsgRemoveCurrencyPairs) GetCurrencyPairIds() []string
func (MsgRemoveCurrencyPairs) GetSigners ¶
func (m MsgRemoveCurrencyPairs) GetSigners() []sdk.AccAddress
GetSigners, get the addresses that must sign this message. In this case, the signer must be the module authority.
func (*MsgRemoveCurrencyPairs) Marshal ¶
func (m *MsgRemoveCurrencyPairs) Marshal() (dAtA []byte, err error)
func (*MsgRemoveCurrencyPairs) MarshalTo ¶
func (m *MsgRemoveCurrencyPairs) MarshalTo(dAtA []byte) (int, error)
func (*MsgRemoveCurrencyPairs) MarshalToSizedBuffer ¶
func (m *MsgRemoveCurrencyPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgRemoveCurrencyPairs) ProtoMessage ¶
func (*MsgRemoveCurrencyPairs) ProtoMessage()
func (*MsgRemoveCurrencyPairs) Reset ¶
func (m *MsgRemoveCurrencyPairs) Reset()
func (*MsgRemoveCurrencyPairs) Size ¶
func (m *MsgRemoveCurrencyPairs) Size() (n int)
func (*MsgRemoveCurrencyPairs) String ¶
func (m *MsgRemoveCurrencyPairs) String() string
func (*MsgRemoveCurrencyPairs) Unmarshal ¶
func (m *MsgRemoveCurrencyPairs) Unmarshal(dAtA []byte) error
func (MsgRemoveCurrencyPairs) ValidateBasic ¶
func (m MsgRemoveCurrencyPairs) ValidateBasic() error
ValidateBasic determines whether or not the information in the message is valid, specifically whether the authority is a valid acc-address, and that each CurrencyPairID in the message is formatted correctly
func (*MsgRemoveCurrencyPairs) XXX_DiscardUnknown ¶
func (m *MsgRemoveCurrencyPairs) XXX_DiscardUnknown()
func (*MsgRemoveCurrencyPairs) XXX_Marshal ¶
func (m *MsgRemoveCurrencyPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgRemoveCurrencyPairs) XXX_Merge ¶
func (m *MsgRemoveCurrencyPairs) XXX_Merge(src proto.Message)
func (*MsgRemoveCurrencyPairs) XXX_Size ¶
func (m *MsgRemoveCurrencyPairs) XXX_Size() int
func (*MsgRemoveCurrencyPairs) XXX_Unmarshal ¶
func (m *MsgRemoveCurrencyPairs) XXX_Unmarshal(b []byte) error
type MsgRemoveCurrencyPairsResponse ¶
type MsgRemoveCurrencyPairsResponse struct { }
func (*MsgRemoveCurrencyPairsResponse) Descriptor ¶
func (*MsgRemoveCurrencyPairsResponse) Descriptor() ([]byte, []int)
func (*MsgRemoveCurrencyPairsResponse) Marshal ¶
func (m *MsgRemoveCurrencyPairsResponse) Marshal() (dAtA []byte, err error)
func (*MsgRemoveCurrencyPairsResponse) MarshalTo ¶
func (m *MsgRemoveCurrencyPairsResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgRemoveCurrencyPairsResponse) MarshalToSizedBuffer ¶
func (m *MsgRemoveCurrencyPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgRemoveCurrencyPairsResponse) ProtoMessage ¶
func (*MsgRemoveCurrencyPairsResponse) ProtoMessage()
func (*MsgRemoveCurrencyPairsResponse) Reset ¶
func (m *MsgRemoveCurrencyPairsResponse) Reset()
func (*MsgRemoveCurrencyPairsResponse) Size ¶
func (m *MsgRemoveCurrencyPairsResponse) Size() (n int)
func (*MsgRemoveCurrencyPairsResponse) String ¶
func (m *MsgRemoveCurrencyPairsResponse) String() string
func (*MsgRemoveCurrencyPairsResponse) Unmarshal ¶
func (m *MsgRemoveCurrencyPairsResponse) Unmarshal(dAtA []byte) error
func (*MsgRemoveCurrencyPairsResponse) XXX_DiscardUnknown ¶
func (m *MsgRemoveCurrencyPairsResponse) XXX_DiscardUnknown()
func (*MsgRemoveCurrencyPairsResponse) XXX_Marshal ¶
func (m *MsgRemoveCurrencyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgRemoveCurrencyPairsResponse) XXX_Merge ¶
func (m *MsgRemoveCurrencyPairsResponse) XXX_Merge(src proto.Message)
func (*MsgRemoveCurrencyPairsResponse) XXX_Size ¶
func (m *MsgRemoveCurrencyPairsResponse) XXX_Size() int
func (*MsgRemoveCurrencyPairsResponse) XXX_Unmarshal ¶
func (m *MsgRemoveCurrencyPairsResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { // AddCurrencyPairs will be used only by governance to update the set of // available CurrencyPairs. Given a set of CurrencyPair objects, update // the available currency pairs in the module . AddCurrencyPairs(context.Context, *MsgAddCurrencyPairs) (*MsgAddCurrencyPairsResponse, error) // RemoveCurrencyPairs will be used explicitly by governance to remove the // given set of currency-pairs from the module's state. Thus these // CurrencyPairs will no longer have price-data available from this module. RemoveCurrencyPairs(context.Context, *MsgRemoveCurrencyPairs) (*MsgRemoveCurrencyPairsResponse, error) }
MsgServer is the server API for Msg service.
type QueryClient ¶
type QueryClient interface { // Get all the currency pairs the x/oracle module is tracking price-data for GetAllCurrencyPairs(ctx context.Context, in *GetAllCurrencyPairsRequest, opts ...grpc.CallOption) (*GetAllCurrencyPairsResponse, error) // Given a CurrencyPair (or its identifier) return the latest QuotePrice for // that CurrencyPair GetPrice(ctx context.Context, in *GetPriceRequest, opts ...grpc.CallOption) (*GetPriceResponse, 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 QueryServer ¶
type QueryServer interface { // Get all the currency pairs the x/oracle module is tracking price-data for GetAllCurrencyPairs(context.Context, *GetAllCurrencyPairsRequest) (*GetAllCurrencyPairsResponse, error) // Given a CurrencyPair (or its identifier) return the latest QuotePrice for // that CurrencyPair GetPrice(context.Context, *GetPriceRequest) (*GetPriceResponse, error) }
QueryServer is the server API for Query service.
type QuotePrice ¶
type QuotePrice struct { Price cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=price,proto3,customtype=cosmossdk.io/math.Int" json:"price"` // BlockTimestamp tracks the block height associated with this price update. // We include block timestamp alongside the price to ensure that smart // contracts and applications are not utilizing stale oracle prices BlockTimestamp time.Time `protobuf:"bytes,2,opt,name=block_timestamp,json=blockTimestamp,proto3,stdtime" json:"block_timestamp"` // BlockHeight is height of block mentioned above BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` }
QuotePrice is the representation of the aggregated prices for a CurrencyPair, where price represents the price of Base in terms of Quote
func (*QuotePrice) Descriptor ¶
func (*QuotePrice) Descriptor() ([]byte, []int)
func (*QuotePrice) GetBlockHeight ¶
func (m *QuotePrice) GetBlockHeight() uint64
func (*QuotePrice) GetBlockTimestamp ¶
func (m *QuotePrice) GetBlockTimestamp() time.Time
func (*QuotePrice) Marshal ¶
func (m *QuotePrice) Marshal() (dAtA []byte, err error)
func (*QuotePrice) MarshalToSizedBuffer ¶
func (m *QuotePrice) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QuotePrice) ProtoMessage ¶
func (*QuotePrice) ProtoMessage()
func (*QuotePrice) Reset ¶
func (m *QuotePrice) Reset()
func (*QuotePrice) Size ¶
func (m *QuotePrice) Size() (n int)
func (*QuotePrice) String ¶
func (m *QuotePrice) String() string
func (*QuotePrice) Unmarshal ¶
func (m *QuotePrice) Unmarshal(dAtA []byte) error
func (QuotePrice) ValidateBasic ¶
func (qp QuotePrice) ValidateBasic() error
ValidateBasic validates that the QuotePrice is valid, i.e that the price is non-negative.
func (*QuotePrice) XXX_DiscardUnknown ¶
func (m *QuotePrice) XXX_DiscardUnknown()
func (*QuotePrice) XXX_Marshal ¶
func (m *QuotePrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QuotePrice) XXX_Merge ¶
func (m *QuotePrice) XXX_Merge(src proto.Message)
func (*QuotePrice) XXX_Size ¶
func (m *QuotePrice) XXX_Size() int
func (*QuotePrice) XXX_Unmarshal ¶
func (m *QuotePrice) XXX_Unmarshal(b []byte) error
type QuotePriceNotExistError ¶
type QuotePriceNotExistError struct {
// contains filtered or unexported fields
}
func NewQuotePriceNotExistError ¶
func NewQuotePriceNotExistError(cp CurrencyPair) QuotePriceNotExistError
func (QuotePriceNotExistError) Error ¶
func (e QuotePriceNotExistError) Error() string
type QuotePriceWithNonce ¶
type QuotePriceWithNonce struct { QuotePrice // contains filtered or unexported fields }
QuotePriceWithNonce is a wrapper around the QuotePrice object which also contains a nonce. The nonce is meant to represent the number of times that the QuotePrice has been updated for a given CurrencyPair.
func NewQuotePriceWithNonce ¶
func NewQuotePriceWithNonce(qp QuotePrice, nonce uint64) QuotePriceWithNonce
func (*QuotePriceWithNonce) Nonce ¶
func (q *QuotePriceWithNonce) Nonce() uint64
Nonce returns the nonce for a given QuotePriceWithNonce
func (QuotePriceWithNonce) ValidateBasic ¶
func (q QuotePriceWithNonce) ValidateBasic() error
ValidateBasic validates that the QuotePriceWithNonce is valid, i.e that the underlying QuotePrice is valid.
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) AddCurrencyPairs ¶
func (*UnimplementedMsgServer) AddCurrencyPairs(ctx context.Context, req *MsgAddCurrencyPairs) (*MsgAddCurrencyPairsResponse, error)
func (*UnimplementedMsgServer) RemoveCurrencyPairs ¶
func (*UnimplementedMsgServer) RemoveCurrencyPairs(ctx context.Context, req *MsgRemoveCurrencyPairs) (*MsgRemoveCurrencyPairsResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) GetAllCurrencyPairs ¶
func (*UnimplementedQueryServer) GetAllCurrencyPairs(ctx context.Context, req *GetAllCurrencyPairsRequest) (*GetAllCurrencyPairsResponse, error)
func (*UnimplementedQueryServer) GetPrice ¶
func (*UnimplementedQueryServer) GetPrice(ctx context.Context, req *GetPriceRequest) (*GetPriceResponse, error)