injective_oracle_rpcpb

package
v1.47.10 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package injective_oracle_rpcpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_injective_oracle_rpc_proto protoreflect.FileDescriptor
View Source
var InjectiveOracleRPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "injective_oracle_rpc.InjectiveOracleRPC",
	HandlerType: (*InjectiveOracleRPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OracleList",
			Handler:    _InjectiveOracleRPC_OracleList_Handler,
		},
		{
			MethodName: "Price",
			Handler:    _InjectiveOracleRPC_Price_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamPrices",
			Handler:       _InjectiveOracleRPC_StreamPrices_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamPricesByMarkets",
			Handler:       _InjectiveOracleRPC_StreamPricesByMarkets_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "injective_oracle_rpc.proto",
}

InjectiveOracleRPC_ServiceDesc is the grpc.ServiceDesc for InjectiveOracleRPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterInjectiveOracleRPCHandler added in v1.32.1

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

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

func RegisterInjectiveOracleRPCHandlerClient added in v1.32.1

func RegisterInjectiveOracleRPCHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InjectiveOracleRPCClient) error

RegisterInjectiveOracleRPCHandlerClient registers the http handlers for service InjectiveOracleRPC to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InjectiveOracleRPCClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InjectiveOracleRPCClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "InjectiveOracleRPCClient" to call the correct interceptors.

func RegisterInjectiveOracleRPCHandlerFromEndpoint added in v1.32.1

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

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

func RegisterInjectiveOracleRPCHandlerServer added in v1.32.1

func RegisterInjectiveOracleRPCHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InjectiveOracleRPCServer) error

RegisterInjectiveOracleRPCHandlerServer registers the http handlers for service InjectiveOracleRPC to "mux". UnaryRPC :call InjectiveOracleRPCServer 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 RegisterInjectiveOracleRPCHandlerFromEndpoint instead.

func RegisterInjectiveOracleRPCServer

func RegisterInjectiveOracleRPCServer(s grpc.ServiceRegistrar, srv InjectiveOracleRPCServer)

Types

type InjectiveOracleRPCClient

type InjectiveOracleRPCClient interface {
	// List all oracles
	OracleList(ctx context.Context, in *OracleListRequest, opts ...grpc.CallOption) (*OracleListResponse, error)
	// Gets the price of the oracle
	Price(ctx context.Context, in *PriceRequest, opts ...grpc.CallOption) (*PriceResponse, error)
	// StreamPrices streams new price changes for a specified oracle. If no oracles
	// are provided, all price changes are streamed.
	StreamPrices(ctx context.Context, in *StreamPricesRequest, opts ...grpc.CallOption) (InjectiveOracleRPC_StreamPricesClient, error)
	// StreamPrices streams new price changes markets
	StreamPricesByMarkets(ctx context.Context, in *StreamPricesByMarketsRequest, opts ...grpc.CallOption) (InjectiveOracleRPC_StreamPricesByMarketsClient, error)
}

InjectiveOracleRPCClient is the client API for InjectiveOracleRPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type InjectiveOracleRPCServer

type InjectiveOracleRPCServer interface {
	// List all oracles
	OracleList(context.Context, *OracleListRequest) (*OracleListResponse, error)
	// Gets the price of the oracle
	Price(context.Context, *PriceRequest) (*PriceResponse, error)
	// StreamPrices streams new price changes for a specified oracle. If no oracles
	// are provided, all price changes are streamed.
	StreamPrices(*StreamPricesRequest, InjectiveOracleRPC_StreamPricesServer) error
	// StreamPrices streams new price changes markets
	StreamPricesByMarkets(*StreamPricesByMarketsRequest, InjectiveOracleRPC_StreamPricesByMarketsServer) error
	// contains filtered or unexported methods
}

InjectiveOracleRPCServer is the server API for InjectiveOracleRPC service. All implementations must embed UnimplementedInjectiveOracleRPCServer for forward compatibility

type InjectiveOracleRPC_StreamPricesByMarketsClient added in v1.44.5

type InjectiveOracleRPC_StreamPricesByMarketsClient interface {
	Recv() (*StreamPricesByMarketsResponse, error)
	grpc.ClientStream
}

type InjectiveOracleRPC_StreamPricesByMarketsServer added in v1.44.5

type InjectiveOracleRPC_StreamPricesByMarketsServer interface {
	Send(*StreamPricesByMarketsResponse) error
	grpc.ServerStream
}

type InjectiveOracleRPC_StreamPricesClient

type InjectiveOracleRPC_StreamPricesClient interface {
	Recv() (*StreamPricesResponse, error)
	grpc.ClientStream
}

type InjectiveOracleRPC_StreamPricesServer

type InjectiveOracleRPC_StreamPricesServer interface {
	Send(*StreamPricesResponse) error
	grpc.ServerStream
}

type Oracle

type Oracle struct {

	// The symbol of the oracle asset.
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// Oracle base currency
	BaseSymbol string `protobuf:"bytes,2,opt,name=base_symbol,json=baseSymbol,proto3" json:"base_symbol,omitempty"`
	// Oracle quote currency
	QuoteSymbol string `protobuf:"bytes,3,opt,name=quote_symbol,json=quoteSymbol,proto3" json:"quote_symbol,omitempty"`
	// Oracle Type
	OracleType string `protobuf:"bytes,4,opt,name=oracle_type,json=oracleType,proto3" json:"oracle_type,omitempty"`
	// The price of the oracle asset
	Price string `protobuf:"bytes,5,opt,name=price,proto3" json:"price,omitempty"`
	// contains filtered or unexported fields
}

func (*Oracle) Descriptor deprecated

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

Deprecated: Use Oracle.ProtoReflect.Descriptor instead.

func (*Oracle) GetBaseSymbol

func (x *Oracle) GetBaseSymbol() string

func (*Oracle) GetOracleType

func (x *Oracle) GetOracleType() string

func (*Oracle) GetPrice

func (x *Oracle) GetPrice() string

func (*Oracle) GetQuoteSymbol

func (x *Oracle) GetQuoteSymbol() string

func (*Oracle) GetSymbol

func (x *Oracle) GetSymbol() string

func (*Oracle) ProtoMessage

func (*Oracle) ProtoMessage()

func (*Oracle) ProtoReflect

func (x *Oracle) ProtoReflect() protoreflect.Message

func (*Oracle) Reset

func (x *Oracle) Reset()

func (*Oracle) String

func (x *Oracle) String() string

type OracleListRequest

type OracleListRequest struct {
	// contains filtered or unexported fields
}

func (*OracleListRequest) Descriptor deprecated

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

Deprecated: Use OracleListRequest.ProtoReflect.Descriptor instead.

func (*OracleListRequest) ProtoMessage

func (*OracleListRequest) ProtoMessage()

func (*OracleListRequest) ProtoReflect

func (x *OracleListRequest) ProtoReflect() protoreflect.Message

func (*OracleListRequest) Reset

func (x *OracleListRequest) Reset()

func (*OracleListRequest) String

func (x *OracleListRequest) String() string

type OracleListResponse

type OracleListResponse struct {
	Oracles []*Oracle `protobuf:"bytes,1,rep,name=oracles,proto3" json:"oracles,omitempty"`
	// contains filtered or unexported fields
}

func (*OracleListResponse) Descriptor deprecated

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

Deprecated: Use OracleListResponse.ProtoReflect.Descriptor instead.

func (*OracleListResponse) GetOracles

func (x *OracleListResponse) GetOracles() []*Oracle

func (*OracleListResponse) ProtoMessage

func (*OracleListResponse) ProtoMessage()

func (*OracleListResponse) ProtoReflect

func (x *OracleListResponse) ProtoReflect() protoreflect.Message

func (*OracleListResponse) Reset

func (x *OracleListResponse) Reset()

func (*OracleListResponse) String

func (x *OracleListResponse) String() string

type PriceRequest

type PriceRequest struct {

	// Oracle base currency
	BaseSymbol string `protobuf:"bytes,1,opt,name=base_symbol,json=baseSymbol,proto3" json:"base_symbol,omitempty"`
	// Oracle quote currency
	QuoteSymbol string `protobuf:"bytes,2,opt,name=quote_symbol,json=quoteSymbol,proto3" json:"quote_symbol,omitempty"`
	// Oracle Type
	OracleType string `protobuf:"bytes,3,opt,name=oracle_type,json=oracleType,proto3" json:"oracle_type,omitempty"`
	// OracleScaleFactor
	OracleScaleFactor uint32 `protobuf:"varint,4,opt,name=oracle_scale_factor,json=oracleScaleFactor,proto3" json:"oracle_scale_factor,omitempty"`
	// contains filtered or unexported fields
}

func (*PriceRequest) Descriptor deprecated

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

Deprecated: Use PriceRequest.ProtoReflect.Descriptor instead.

func (*PriceRequest) GetBaseSymbol

func (x *PriceRequest) GetBaseSymbol() string

func (*PriceRequest) GetOracleScaleFactor

func (x *PriceRequest) GetOracleScaleFactor() uint32

func (*PriceRequest) GetOracleType

func (x *PriceRequest) GetOracleType() string

func (*PriceRequest) GetQuoteSymbol

func (x *PriceRequest) GetQuoteSymbol() string

func (*PriceRequest) ProtoMessage

func (*PriceRequest) ProtoMessage()

func (*PriceRequest) ProtoReflect

func (x *PriceRequest) ProtoReflect() protoreflect.Message

func (*PriceRequest) Reset

func (x *PriceRequest) Reset()

func (*PriceRequest) String

func (x *PriceRequest) String() string

type PriceResponse

type PriceResponse struct {

	// The price of the oracle asset
	Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"`
	// contains filtered or unexported fields
}

func (*PriceResponse) Descriptor deprecated

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

Deprecated: Use PriceResponse.ProtoReflect.Descriptor instead.

func (*PriceResponse) GetPrice

func (x *PriceResponse) GetPrice() string

func (*PriceResponse) ProtoMessage

func (*PriceResponse) ProtoMessage()

func (*PriceResponse) ProtoReflect

func (x *PriceResponse) ProtoReflect() protoreflect.Message

func (*PriceResponse) Reset

func (x *PriceResponse) Reset()

func (*PriceResponse) String

func (x *PriceResponse) String() string

type StreamPricesByMarketsRequest added in v1.44.5

type StreamPricesByMarketsRequest struct {

	// marketIDs to stream price for, empty to listen for all prices
	MarketIds []string `protobuf:"bytes,1,rep,name=market_ids,json=marketIds,proto3" json:"market_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamPricesByMarketsRequest) Descriptor deprecated added in v1.44.5

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

Deprecated: Use StreamPricesByMarketsRequest.ProtoReflect.Descriptor instead.

func (*StreamPricesByMarketsRequest) GetMarketIds added in v1.44.5

func (x *StreamPricesByMarketsRequest) GetMarketIds() []string

func (*StreamPricesByMarketsRequest) ProtoMessage added in v1.44.5

func (*StreamPricesByMarketsRequest) ProtoMessage()

func (*StreamPricesByMarketsRequest) ProtoReflect added in v1.44.5

func (*StreamPricesByMarketsRequest) Reset added in v1.44.5

func (x *StreamPricesByMarketsRequest) Reset()

func (*StreamPricesByMarketsRequest) String added in v1.44.5

type StreamPricesByMarketsResponse added in v1.44.5

type StreamPricesByMarketsResponse struct {

	// The price of the oracle asset
	Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"`
	// Operation timestamp in UNIX millis.
	Timestamp int64 `protobuf:"zigzag64,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// marketID that the price has been updated
	MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamPricesByMarketsResponse) Descriptor deprecated added in v1.44.5

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

Deprecated: Use StreamPricesByMarketsResponse.ProtoReflect.Descriptor instead.

func (*StreamPricesByMarketsResponse) GetMarketId added in v1.44.5

func (x *StreamPricesByMarketsResponse) GetMarketId() string

func (*StreamPricesByMarketsResponse) GetPrice added in v1.44.5

func (x *StreamPricesByMarketsResponse) GetPrice() string

func (*StreamPricesByMarketsResponse) GetTimestamp added in v1.44.5

func (x *StreamPricesByMarketsResponse) GetTimestamp() int64

func (*StreamPricesByMarketsResponse) ProtoMessage added in v1.44.5

func (*StreamPricesByMarketsResponse) ProtoMessage()

func (*StreamPricesByMarketsResponse) ProtoReflect added in v1.44.5

func (*StreamPricesByMarketsResponse) Reset added in v1.44.5

func (x *StreamPricesByMarketsResponse) Reset()

func (*StreamPricesByMarketsResponse) String added in v1.44.5

type StreamPricesRequest

type StreamPricesRequest struct {

	// Oracle base currency
	BaseSymbol string `protobuf:"bytes,1,opt,name=base_symbol,json=baseSymbol,proto3" json:"base_symbol,omitempty"`
	// Oracle quote currency
	QuoteSymbol string `protobuf:"bytes,2,opt,name=quote_symbol,json=quoteSymbol,proto3" json:"quote_symbol,omitempty"`
	// Oracle Type
	OracleType string `protobuf:"bytes,3,opt,name=oracle_type,json=oracleType,proto3" json:"oracle_type,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamPricesRequest) Descriptor deprecated

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

Deprecated: Use StreamPricesRequest.ProtoReflect.Descriptor instead.

func (*StreamPricesRequest) GetBaseSymbol

func (x *StreamPricesRequest) GetBaseSymbol() string

func (*StreamPricesRequest) GetOracleType

func (x *StreamPricesRequest) GetOracleType() string

func (*StreamPricesRequest) GetQuoteSymbol

func (x *StreamPricesRequest) GetQuoteSymbol() string

func (*StreamPricesRequest) ProtoMessage

func (*StreamPricesRequest) ProtoMessage()

func (*StreamPricesRequest) ProtoReflect

func (x *StreamPricesRequest) ProtoReflect() protoreflect.Message

func (*StreamPricesRequest) Reset

func (x *StreamPricesRequest) Reset()

func (*StreamPricesRequest) String

func (x *StreamPricesRequest) String() string

type StreamPricesResponse

type StreamPricesResponse struct {

	// The price of the oracle asset
	Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"`
	// Operation timestamp in UNIX millis.
	Timestamp int64 `protobuf:"zigzag64,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamPricesResponse) Descriptor deprecated

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

Deprecated: Use StreamPricesResponse.ProtoReflect.Descriptor instead.

func (*StreamPricesResponse) GetPrice

func (x *StreamPricesResponse) GetPrice() string

func (*StreamPricesResponse) GetTimestamp

func (x *StreamPricesResponse) GetTimestamp() int64

func (*StreamPricesResponse) ProtoMessage

func (*StreamPricesResponse) ProtoMessage()

func (*StreamPricesResponse) ProtoReflect

func (x *StreamPricesResponse) ProtoReflect() protoreflect.Message

func (*StreamPricesResponse) Reset

func (x *StreamPricesResponse) Reset()

func (*StreamPricesResponse) String

func (x *StreamPricesResponse) String() string

type UnimplementedInjectiveOracleRPCServer

type UnimplementedInjectiveOracleRPCServer struct {
}

UnimplementedInjectiveOracleRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedInjectiveOracleRPCServer) OracleList

func (UnimplementedInjectiveOracleRPCServer) Price

func (UnimplementedInjectiveOracleRPCServer) StreamPrices

func (UnimplementedInjectiveOracleRPCServer) StreamPricesByMarkets added in v1.44.5

type UnsafeInjectiveOracleRPCServer

type UnsafeInjectiveOracleRPCServer interface {
	// contains filtered or unexported methods
}

UnsafeInjectiveOracleRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InjectiveOracleRPCServer will result in compilation errors.

Jump to

Keyboard shortcuts

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