Documentation ¶
Index ¶
- Variables
- func RegisterGrantsServiceServer(s grpc1.Server, srv GrantsServiceServer)
- type ChainClient
- type Database
- type GetFeeAllowanceDetailsRequest
- func (*GetFeeAllowanceDetailsRequest) Descriptor() ([]byte, []int)
- func (m *GetFeeAllowanceDetailsRequest) GetRequestId() string
- func (m *GetFeeAllowanceDetailsRequest) Marshal() (dAtA []byte, err error)
- func (m *GetFeeAllowanceDetailsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetFeeAllowanceDetailsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetFeeAllowanceDetailsRequest) ProtoMessage()
- func (m *GetFeeAllowanceDetailsRequest) Reset()
- func (m *GetFeeAllowanceDetailsRequest) Size() (n int)
- func (m *GetFeeAllowanceDetailsRequest) String() string
- func (m *GetFeeAllowanceDetailsRequest) Unmarshal(dAtA []byte) error
- func (m *GetFeeAllowanceDetailsRequest) XXX_DiscardUnknown()
- func (m *GetFeeAllowanceDetailsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetFeeAllowanceDetailsRequest) XXX_Merge(src proto.Message)
- func (m *GetFeeAllowanceDetailsRequest) XXX_Size() int
- func (m *GetFeeAllowanceDetailsRequest) XXX_Unmarshal(b []byte) error
- type GetFeeAllowanceDetailsResponse
- func (*GetFeeAllowanceDetailsResponse) Descriptor() ([]byte, []int)
- func (m *GetFeeAllowanceDetailsResponse) GetAllowance() *types.Any
- func (m *GetFeeAllowanceDetailsResponse) GetGrantTime() *time.Time
- func (m *GetFeeAllowanceDetailsResponse) GetRequestTime() time.Time
- func (m *GetFeeAllowanceDetailsResponse) GetUserDesmosAddress() string
- func (m *GetFeeAllowanceDetailsResponse) Marshal() (dAtA []byte, err error)
- func (m *GetFeeAllowanceDetailsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetFeeAllowanceDetailsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetFeeAllowanceDetailsResponse) ProtoMessage()
- func (m *GetFeeAllowanceDetailsResponse) Reset()
- func (m *GetFeeAllowanceDetailsResponse) Size() (n int)
- func (m *GetFeeAllowanceDetailsResponse) String() string
- func (m *GetFeeAllowanceDetailsResponse) Unmarshal(dAtA []byte) error
- func (m *GetFeeAllowanceDetailsResponse) XXX_DiscardUnknown()
- func (m *GetFeeAllowanceDetailsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetFeeAllowanceDetailsResponse) XXX_Merge(src proto.Message)
- func (m *GetFeeAllowanceDetailsResponse) XXX_Size() int
- func (m *GetFeeAllowanceDetailsResponse) XXX_Unmarshal(b []byte) error
- type GrantsServiceClient
- type GrantsServiceServer
- type Handler
- type RequestFeeAllowanceRequest
- func (*RequestFeeAllowanceRequest) Descriptor() ([]byte, []int)
- func (m *RequestFeeAllowanceRequest) GetAllowance() *types.Any
- func (m *RequestFeeAllowanceRequest) GetUserDesmosAddress() string
- func (m *RequestFeeAllowanceRequest) Marshal() (dAtA []byte, err error)
- func (m *RequestFeeAllowanceRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *RequestFeeAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RequestFeeAllowanceRequest) ProtoMessage()
- func (m *RequestFeeAllowanceRequest) Reset()
- func (m *RequestFeeAllowanceRequest) Size() (n int)
- func (m *RequestFeeAllowanceRequest) String() string
- func (m *RequestFeeAllowanceRequest) Unmarshal(dAtA []byte) error
- func (m *RequestFeeAllowanceRequest) XXX_DiscardUnknown()
- func (m *RequestFeeAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RequestFeeAllowanceRequest) XXX_Merge(src proto.Message)
- func (m *RequestFeeAllowanceRequest) XXX_Size() int
- func (m *RequestFeeAllowanceRequest) XXX_Unmarshal(b []byte) error
- type RequestFeeAllowanceResponse
- func (*RequestFeeAllowanceResponse) Descriptor() ([]byte, []int)
- func (m *RequestFeeAllowanceResponse) GetRequestId() string
- func (m *RequestFeeAllowanceResponse) Marshal() (dAtA []byte, err error)
- func (m *RequestFeeAllowanceResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *RequestFeeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RequestFeeAllowanceResponse) ProtoMessage()
- func (m *RequestFeeAllowanceResponse) Reset()
- func (m *RequestFeeAllowanceResponse) Size() (n int)
- func (m *RequestFeeAllowanceResponse) String() string
- func (m *RequestFeeAllowanceResponse) Unmarshal(dAtA []byte) error
- func (m *RequestFeeAllowanceResponse) XXX_DiscardUnknown()
- func (m *RequestFeeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RequestFeeAllowanceResponse) XXX_Merge(src proto.Message)
- func (m *RequestFeeAllowanceResponse) XXX_Size() int
- func (m *RequestFeeAllowanceResponse) XXX_Unmarshal(b []byte) error
- type RequestFeeGrantDetailsRequest
- type RequestFeeGrantRequest
- type Server
- type UnimplementedGrantsServiceServer
- func (*UnimplementedGrantsServiceServer) GetFeeAllowanceDetails(ctx context.Context, req *GetFeeAllowanceDetailsRequest) (*GetFeeAllowanceDetailsResponse, error)
- func (*UnimplementedGrantsServiceServer) RequestFeeAllowance(ctx context.Context, req *RequestFeeAllowanceRequest) (*RequestFeeAllowanceResponse, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterGrantsServiceServer ¶
func RegisterGrantsServiceServer(s grpc1.Server, srv GrantsServiceServer)
Types ¶
type ChainClient ¶
type Database ¶
type Database interface { GetApp(appID string) (*types.Application, bool, error) GetAppFeeGrantRequestsLimit(appID string) (uint64, error) GetAppFeeGrantRequestsCount(appID string) (uint64, error) SaveFeeGrantRequest(request types.FeeGrantRequest) error HasFeeGrantBeenGrantedToUser(appID string, user string) (bool, error) GetFeeGrantRequest(appID string, requestID string) (*types.FeeGrantRequest, bool, error) }
type GetFeeAllowanceDetailsRequest ¶
type GetFeeAllowanceDetailsRequest struct { // ID represents the ID of the fee allowance request to query RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` }
func (*GetFeeAllowanceDetailsRequest) Descriptor ¶
func (*GetFeeAllowanceDetailsRequest) Descriptor() ([]byte, []int)
func (*GetFeeAllowanceDetailsRequest) GetRequestId ¶
func (m *GetFeeAllowanceDetailsRequest) GetRequestId() string
func (*GetFeeAllowanceDetailsRequest) Marshal ¶
func (m *GetFeeAllowanceDetailsRequest) Marshal() (dAtA []byte, err error)
func (*GetFeeAllowanceDetailsRequest) MarshalTo ¶
func (m *GetFeeAllowanceDetailsRequest) MarshalTo(dAtA []byte) (int, error)
func (*GetFeeAllowanceDetailsRequest) MarshalToSizedBuffer ¶
func (m *GetFeeAllowanceDetailsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetFeeAllowanceDetailsRequest) ProtoMessage ¶
func (*GetFeeAllowanceDetailsRequest) ProtoMessage()
func (*GetFeeAllowanceDetailsRequest) Reset ¶
func (m *GetFeeAllowanceDetailsRequest) Reset()
func (*GetFeeAllowanceDetailsRequest) Size ¶
func (m *GetFeeAllowanceDetailsRequest) Size() (n int)
func (*GetFeeAllowanceDetailsRequest) String ¶
func (m *GetFeeAllowanceDetailsRequest) String() string
func (*GetFeeAllowanceDetailsRequest) Unmarshal ¶
func (m *GetFeeAllowanceDetailsRequest) Unmarshal(dAtA []byte) error
func (*GetFeeAllowanceDetailsRequest) XXX_DiscardUnknown ¶
func (m *GetFeeAllowanceDetailsRequest) XXX_DiscardUnknown()
func (*GetFeeAllowanceDetailsRequest) XXX_Marshal ¶
func (m *GetFeeAllowanceDetailsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetFeeAllowanceDetailsRequest) XXX_Merge ¶
func (m *GetFeeAllowanceDetailsRequest) XXX_Merge(src proto.Message)
func (*GetFeeAllowanceDetailsRequest) XXX_Size ¶
func (m *GetFeeAllowanceDetailsRequest) XXX_Size() int
func (*GetFeeAllowanceDetailsRequest) XXX_Unmarshal ¶
func (m *GetFeeAllowanceDetailsRequest) XXX_Unmarshal(b []byte) error
type GetFeeAllowanceDetailsResponse ¶
type GetFeeAllowanceDetailsResponse struct { // UserDesmosAddress represents the Desmos address of the user that // already has (or will be) granted the fee allowance UserDesmosAddress string `protobuf:"bytes,1,opt,name=user_desmos_address,json=userDesmosAddress,proto3" json:"user_desmos_address,omitempty"` // Allowance represents the fee allowance that has been granted to the user // with the specified ID Allowance *types.Any `protobuf:"bytes,2,opt,name=allowance,proto3" json:"allowance,omitempty"` // RequestTime represents the time at which the fee allowance has been // requested RequestTime time.Time `protobuf:"bytes,3,opt,name=request_time,json=requestTime,proto3,stdtime" json:"request_time"` // GrantTime represents the time at which the fee allowance has been granted. // If nil, it means that the allowance has not been granted yet GrantTime *time.Time `protobuf:"bytes,4,opt,name=grant_time,json=grantTime,proto3,stdtime" json:"grant_time,omitempty"` }
func (*GetFeeAllowanceDetailsResponse) Descriptor ¶
func (*GetFeeAllowanceDetailsResponse) Descriptor() ([]byte, []int)
func (*GetFeeAllowanceDetailsResponse) GetAllowance ¶
func (m *GetFeeAllowanceDetailsResponse) GetAllowance() *types.Any
func (*GetFeeAllowanceDetailsResponse) GetGrantTime ¶
func (m *GetFeeAllowanceDetailsResponse) GetGrantTime() *time.Time
func (*GetFeeAllowanceDetailsResponse) GetRequestTime ¶
func (m *GetFeeAllowanceDetailsResponse) GetRequestTime() time.Time
func (*GetFeeAllowanceDetailsResponse) GetUserDesmosAddress ¶
func (m *GetFeeAllowanceDetailsResponse) GetUserDesmosAddress() string
func (*GetFeeAllowanceDetailsResponse) Marshal ¶
func (m *GetFeeAllowanceDetailsResponse) Marshal() (dAtA []byte, err error)
func (*GetFeeAllowanceDetailsResponse) MarshalTo ¶
func (m *GetFeeAllowanceDetailsResponse) MarshalTo(dAtA []byte) (int, error)
func (*GetFeeAllowanceDetailsResponse) MarshalToSizedBuffer ¶
func (m *GetFeeAllowanceDetailsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetFeeAllowanceDetailsResponse) ProtoMessage ¶
func (*GetFeeAllowanceDetailsResponse) ProtoMessage()
func (*GetFeeAllowanceDetailsResponse) Reset ¶
func (m *GetFeeAllowanceDetailsResponse) Reset()
func (*GetFeeAllowanceDetailsResponse) Size ¶
func (m *GetFeeAllowanceDetailsResponse) Size() (n int)
func (*GetFeeAllowanceDetailsResponse) String ¶
func (m *GetFeeAllowanceDetailsResponse) String() string
func (*GetFeeAllowanceDetailsResponse) Unmarshal ¶
func (m *GetFeeAllowanceDetailsResponse) Unmarshal(dAtA []byte) error
func (*GetFeeAllowanceDetailsResponse) XXX_DiscardUnknown ¶
func (m *GetFeeAllowanceDetailsResponse) XXX_DiscardUnknown()
func (*GetFeeAllowanceDetailsResponse) XXX_Marshal ¶
func (m *GetFeeAllowanceDetailsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetFeeAllowanceDetailsResponse) XXX_Merge ¶
func (m *GetFeeAllowanceDetailsResponse) XXX_Merge(src proto.Message)
func (*GetFeeAllowanceDetailsResponse) XXX_Size ¶
func (m *GetFeeAllowanceDetailsResponse) XXX_Size() int
func (*GetFeeAllowanceDetailsResponse) XXX_Unmarshal ¶
func (m *GetFeeAllowanceDetailsResponse) XXX_Unmarshal(b []byte) error
type GrantsServiceClient ¶
type GrantsServiceClient interface { // RequestFeeAllowance allows to request a new fee allowance for a given user RequestFeeAllowance(ctx context.Context, in *RequestFeeAllowanceRequest, opts ...grpc.CallOption) (*RequestFeeAllowanceResponse, error) // GetFeeAllowanceDetails allows to get the details of a fee allowance request GetFeeAllowanceDetails(ctx context.Context, in *GetFeeAllowanceDetailsRequest, opts ...grpc.CallOption) (*GetFeeAllowanceDetailsResponse, error) }
GrantsServiceClient is the client API for GrantsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGrantsServiceClient ¶
func NewGrantsServiceClient(cc grpc1.ClientConn) GrantsServiceClient
type GrantsServiceServer ¶
type GrantsServiceServer interface { // RequestFeeAllowance allows to request a new fee allowance for a given user RequestFeeAllowance(context.Context, *RequestFeeAllowanceRequest) (*RequestFeeAllowanceResponse, error) // GetFeeAllowanceDetails allows to get the details of a fee allowance request GetFeeAllowanceDetails(context.Context, *GetFeeAllowanceDetailsRequest) (*GetFeeAllowanceDetailsResponse, error) }
GrantsServiceServer is the server API for GrantsService service.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(client ChainClient, cdc codec.Codec, db Database) *Handler
NewHandler returns a new Handler instance
func (*Handler) HandleFeeGrantRequest ¶
func (h *Handler) HandleFeeGrantRequest(req *RequestFeeGrantRequest) (*RequestFeeAllowanceResponse, error)
HandleFeeGrantRequest handles the request of a fee grant from the user having the given token
func (*Handler) HandleRequestFeeGrantDetailsRequest ¶
func (h *Handler) HandleRequestFeeGrantDetailsRequest(req *RequestFeeGrantDetailsRequest) (*GetFeeAllowanceDetailsResponse, error)
type RequestFeeAllowanceRequest ¶
type RequestFeeAllowanceRequest struct { // UserDesmosAddress represents the Desmos address of the user that // should be granted the fee allowance UserDesmosAddress string `protobuf:"bytes,1,opt,name=user_desmos_address,json=userDesmosAddress,proto3" json:"user_desmos_address,omitempty"` // Allowance represents the fee allowance that will be granted to the user. // IT can be any allowance type that implements AllowanceI Allowance *types.Any `protobuf:"bytes,2,opt,name=allowance,proto3" json:"allowance,omitempty"` }
func (*RequestFeeAllowanceRequest) Descriptor ¶
func (*RequestFeeAllowanceRequest) Descriptor() ([]byte, []int)
func (*RequestFeeAllowanceRequest) GetAllowance ¶
func (m *RequestFeeAllowanceRequest) GetAllowance() *types.Any
func (*RequestFeeAllowanceRequest) GetUserDesmosAddress ¶
func (m *RequestFeeAllowanceRequest) GetUserDesmosAddress() string
func (*RequestFeeAllowanceRequest) Marshal ¶
func (m *RequestFeeAllowanceRequest) Marshal() (dAtA []byte, err error)
func (*RequestFeeAllowanceRequest) MarshalTo ¶
func (m *RequestFeeAllowanceRequest) MarshalTo(dAtA []byte) (int, error)
func (*RequestFeeAllowanceRequest) MarshalToSizedBuffer ¶
func (m *RequestFeeAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RequestFeeAllowanceRequest) ProtoMessage ¶
func (*RequestFeeAllowanceRequest) ProtoMessage()
func (*RequestFeeAllowanceRequest) Reset ¶
func (m *RequestFeeAllowanceRequest) Reset()
func (*RequestFeeAllowanceRequest) Size ¶
func (m *RequestFeeAllowanceRequest) Size() (n int)
func (*RequestFeeAllowanceRequest) String ¶
func (m *RequestFeeAllowanceRequest) String() string
func (*RequestFeeAllowanceRequest) Unmarshal ¶
func (m *RequestFeeAllowanceRequest) Unmarshal(dAtA []byte) error
func (*RequestFeeAllowanceRequest) XXX_DiscardUnknown ¶
func (m *RequestFeeAllowanceRequest) XXX_DiscardUnknown()
func (*RequestFeeAllowanceRequest) XXX_Marshal ¶
func (m *RequestFeeAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RequestFeeAllowanceRequest) XXX_Merge ¶
func (m *RequestFeeAllowanceRequest) XXX_Merge(src proto.Message)
func (*RequestFeeAllowanceRequest) XXX_Size ¶
func (m *RequestFeeAllowanceRequest) XXX_Size() int
func (*RequestFeeAllowanceRequest) XXX_Unmarshal ¶
func (m *RequestFeeAllowanceRequest) XXX_Unmarshal(b []byte) error
type RequestFeeAllowanceResponse ¶
type RequestFeeAllowanceResponse struct { // ID represents the ID of the fee allowance request RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` }
func (*RequestFeeAllowanceResponse) Descriptor ¶
func (*RequestFeeAllowanceResponse) Descriptor() ([]byte, []int)
func (*RequestFeeAllowanceResponse) GetRequestId ¶
func (m *RequestFeeAllowanceResponse) GetRequestId() string
func (*RequestFeeAllowanceResponse) Marshal ¶
func (m *RequestFeeAllowanceResponse) Marshal() (dAtA []byte, err error)
func (*RequestFeeAllowanceResponse) MarshalTo ¶
func (m *RequestFeeAllowanceResponse) MarshalTo(dAtA []byte) (int, error)
func (*RequestFeeAllowanceResponse) MarshalToSizedBuffer ¶
func (m *RequestFeeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RequestFeeAllowanceResponse) ProtoMessage ¶
func (*RequestFeeAllowanceResponse) ProtoMessage()
func (*RequestFeeAllowanceResponse) Reset ¶
func (m *RequestFeeAllowanceResponse) Reset()
func (*RequestFeeAllowanceResponse) Size ¶
func (m *RequestFeeAllowanceResponse) Size() (n int)
func (*RequestFeeAllowanceResponse) String ¶
func (m *RequestFeeAllowanceResponse) String() string
func (*RequestFeeAllowanceResponse) Unmarshal ¶
func (m *RequestFeeAllowanceResponse) Unmarshal(dAtA []byte) error
func (*RequestFeeAllowanceResponse) XXX_DiscardUnknown ¶
func (m *RequestFeeAllowanceResponse) XXX_DiscardUnknown()
func (*RequestFeeAllowanceResponse) XXX_Marshal ¶
func (m *RequestFeeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RequestFeeAllowanceResponse) XXX_Merge ¶
func (m *RequestFeeAllowanceResponse) XXX_Merge(src proto.Message)
func (*RequestFeeAllowanceResponse) XXX_Size ¶
func (m *RequestFeeAllowanceResponse) XXX_Size() int
func (*RequestFeeAllowanceResponse) XXX_Unmarshal ¶
func (m *RequestFeeAllowanceResponse) XXX_Unmarshal(b []byte) error
type RequestFeeGrantDetailsRequest ¶
type RequestFeeGrantDetailsRequest struct { // AppID represents the ID of the application that is requesting the fee grant details AppID string // FeeGrantAllowanceRequestID represents the id of the fee grant request for which to get the details FeeGrantAllowanceRequestID string }
func NewRequestFeeGrantDetailsRequest ¶
func NewRequestFeeGrantDetailsRequest(appID string, feeGrantAllowanceRequestID string) *RequestFeeGrantDetailsRequest
type RequestFeeGrantRequest ¶
type RequestFeeGrantRequest struct { // AppID represents the ID of the application that is requesting the fee grant AppID string // DesmosAddress is the address of the user requesting the fee grant DesmosAddress string // Allowance represents the allowance to be granted to the user Allowance *codectypes.Any }
func NewRequestFeeGrantRequest ¶
func NewRequestFeeGrantRequest(appID string, desmosAddress string, allowance *codectypes.Any) *RequestFeeGrantRequest
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServerFromEnvVariables ¶
func NewServerFromEnvVariables(chainClient ChainClient, cdc codec.Codec, db Database) *Server
func (*Server) GetFeeAllowanceDetails ¶
func (s *Server) GetFeeAllowanceDetails(ctx context.Context, request *GetFeeAllowanceDetailsRequest) (*GetFeeAllowanceDetailsResponse, error)
GetFeeAllowanceDetails implements GrantsServiceServer
func (*Server) RequestFeeAllowance ¶
func (s *Server) RequestFeeAllowance(ctx context.Context, request *RequestFeeAllowanceRequest) (*RequestFeeAllowanceResponse, error)
RequestFeeAllowance implements GrantsServiceServer
type UnimplementedGrantsServiceServer ¶
type UnimplementedGrantsServiceServer struct { }
UnimplementedGrantsServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedGrantsServiceServer) GetFeeAllowanceDetails ¶
func (*UnimplementedGrantsServiceServer) GetFeeAllowanceDetails(ctx context.Context, req *GetFeeAllowanceDetailsRequest) (*GetFeeAllowanceDetailsResponse, error)
func (*UnimplementedGrantsServiceServer) RequestFeeAllowance ¶
func (*UnimplementedGrantsServiceServer) RequestFeeAllowance(ctx context.Context, req *RequestFeeAllowanceRequest) (*RequestFeeAllowanceResponse, error)
Click to show internal directories.
Click to hide internal directories.