Documentation ¶
Overview ¶
Package allowance contains
- chaincode methods names {service_name}Chaincode_{method_name}
- chaincode interface definition {service_name}Chaincode
- chaincode gateway definition {service_name}}Gateway
- chaincode service to cckit router registration func
Package allowance is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func Event(ctx router.Context) state.Event
- func RegisterAllowanceServiceChaincode(r *cckit_router.Group, cc AllowanceServiceChaincode) error
- func RegisterAllowanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAllowanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AllowanceServiceClient) error
- func RegisterAllowanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAllowanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AllowanceServiceServer) error
- func RegisterAllowanceServiceServer(s *grpc.Server, srv AllowanceServiceServer)
- func State(ctx router.Context) m.MappedState
- type Allowance
- func (*Allowance) Descriptor() ([]byte, []int)deprecated
- func (x *Allowance) GetAmount() uint64
- func (x *Allowance) GetOwnerAddress() string
- func (x *Allowance) GetSpenderAddress() string
- func (x *Allowance) GetToken() []string
- func (*Allowance) ProtoMessage()
- func (x *Allowance) ProtoReflect() protoreflect.Message
- func (x *Allowance) Reset()
- func (x *Allowance) String() string
- func (this *Allowance) Validate() error
- type AllowanceId
- func (*AllowanceId) Descriptor() ([]byte, []int)deprecated
- func (x *AllowanceId) GetOwnerAddress() string
- func (x *AllowanceId) GetSpenderAddress() string
- func (x *AllowanceId) GetToken() []string
- func (*AllowanceId) ProtoMessage()
- func (x *AllowanceId) ProtoReflect() protoreflect.Message
- func (x *AllowanceId) Reset()
- func (x *AllowanceId) String() string
- func (this *AllowanceId) Validate() error
- type AllowanceRequest
- func (*AllowanceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AllowanceRequest) GetOwnerAddress() string
- func (x *AllowanceRequest) GetSpenderAddress() string
- func (x *AllowanceRequest) GetToken() []string
- func (*AllowanceRequest) ProtoMessage()
- func (x *AllowanceRequest) ProtoReflect() protoreflect.Message
- func (x *AllowanceRequest) Reset()
- func (x *AllowanceRequest) String() string
- func (this *AllowanceRequest) Validate() error
- type AllowanceServiceChaincode
- type AllowanceServiceChaincodeLocalResolver
- type AllowanceServiceChaincodeLocatorResolver
- type AllowanceServiceChaincodeResolver
- type AllowanceServiceChaincodeStubInvoker
- func (c *AllowanceServiceChaincodeStubInvoker) Approve(ctx cckit_router.Context, in *ApproveRequest) (*Allowance, error)
- func (c *AllowanceServiceChaincodeStubInvoker) GetAllowance(ctx cckit_router.Context, in *AllowanceRequest) (*Allowance, error)
- func (c *AllowanceServiceChaincodeStubInvoker) TransferFrom(ctx cckit_router.Context, in *TransferFromRequest) (*TransferFromResponse, error)
- type AllowanceServiceClient
- type AllowanceServiceGateway
- func (c *AllowanceServiceGateway) Approve(ctx context.Context, in *ApproveRequest) (*Allowance, error)
- func (c *AllowanceServiceGateway) GetAllowance(ctx context.Context, in *AllowanceRequest) (*Allowance, error)
- func (c *AllowanceServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
- func (c *AllowanceServiceGateway) ServiceDef() cckit_gateway.ServiceDef
- func (c *AllowanceServiceGateway) TransferFrom(ctx context.Context, in *TransferFromRequest) (*TransferFromResponse, error)
- type AllowanceServiceServer
- type Allowances
- func (*Allowances) Descriptor() ([]byte, []int)deprecated
- func (x *Allowances) GetItems() []*Allowance
- func (*Allowances) ProtoMessage()
- func (x *Allowances) ProtoReflect() protoreflect.Message
- func (x *Allowances) Reset()
- func (x *Allowances) String() string
- func (this *Allowances) Validate() error
- type ApproveRequest
- func (*ApproveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ApproveRequest) GetAmount() uint64
- func (x *ApproveRequest) GetOwnerAddress() string
- func (x *ApproveRequest) GetSpenderAddress() string
- func (x *ApproveRequest) GetToken() []string
- func (*ApproveRequest) ProtoMessage()
- func (x *ApproveRequest) ProtoReflect() protoreflect.Message
- func (x *ApproveRequest) Reset()
- func (x *ApproveRequest) String() string
- func (this *ApproveRequest) Validate() error
- type Approved
- func (*Approved) Descriptor() ([]byte, []int)deprecated
- func (x *Approved) GetAmount() uint64
- func (x *Approved) GetOwnerAddress() string
- func (x *Approved) GetSpenderAddress() string
- func (x *Approved) GetToken() []string
- func (*Approved) ProtoMessage()
- func (x *Approved) ProtoReflect() protoreflect.Message
- func (x *Approved) Reset()
- func (x *Approved) String() string
- func (this *Approved) Validate() error
- type Service
- type Store
- func (s *Store) Get(ownerAddress, spenderAddress string, token []string) (*Allowance, error)
- func (s *Store) Set(ownerAddress, spenderAddress string, token []string, amount uint64) (*Allowance, error)
- func (s *Store) Sub(ownerAddress, spenderAddress string, token []string, amount uint64) (*Allowance, error)
- type TransferFromRequest
- func (*TransferFromRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferFromRequest) GetAmount() uint64
- func (x *TransferFromRequest) GetOwnerAddress() string
- func (x *TransferFromRequest) GetRecipientAddress() string
- func (x *TransferFromRequest) GetToken() []string
- func (*TransferFromRequest) ProtoMessage()
- func (x *TransferFromRequest) ProtoReflect() protoreflect.Message
- func (x *TransferFromRequest) Reset()
- func (x *TransferFromRequest) String() string
- func (this *TransferFromRequest) Validate() error
- type TransferFromResponse
- func (*TransferFromResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TransferFromResponse) GetAmount() uint64
- func (x *TransferFromResponse) GetOwnerAddress() string
- func (x *TransferFromResponse) GetRecipientAddress() string
- func (x *TransferFromResponse) GetToken() []string
- func (*TransferFromResponse) ProtoMessage()
- func (x *TransferFromResponse) ProtoReflect() protoreflect.Message
- func (x *TransferFromResponse) Reset()
- func (x *TransferFromResponse) String() string
- func (this *TransferFromResponse) Validate() error
- type TransferredFrom
- func (*TransferredFrom) Descriptor() ([]byte, []int)deprecated
- func (x *TransferredFrom) GetAmount() uint64
- func (x *TransferredFrom) GetOwnerAddress() string
- func (x *TransferredFrom) GetRecipientAddress() string
- func (x *TransferredFrom) GetSpenderAddress() string
- func (x *TransferredFrom) GetToken() []string
- func (*TransferredFrom) ProtoMessage()
- func (x *TransferredFrom) ProtoReflect() protoreflect.Message
- func (x *TransferredFrom) Reset()
- func (x *TransferredFrom) String() string
- func (this *TransferredFrom) Validate() error
- type UnimplementedAllowanceServiceServer
- func (*UnimplementedAllowanceServiceServer) Approve(context.Context, *ApproveRequest) (*Allowance, error)
- func (*UnimplementedAllowanceServiceServer) GetAllowance(context.Context, *AllowanceRequest) (*Allowance, error)
- func (*UnimplementedAllowanceServiceServer) TransferFrom(context.Context, *TransferFromRequest) (*TransferFromResponse, error)
Constants ¶
const ( // AllowanceServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode AllowanceServiceChaincodeMethodPrefix = "" AllowanceServiceChaincode_GetAllowance = AllowanceServiceChaincodeMethodPrefix + "GetAllowance" AllowanceServiceChaincode_Approve = AllowanceServiceChaincodeMethodPrefix + "Approve" AllowanceServiceChaincode_TransferFrom = AllowanceServiceChaincodeMethodPrefix + "TransferFrom" )
AllowanceServiceChaincode method names
Variables ¶
var ( ErrOwnerOnly = errors.New(`owner only`) ErrAllowanceInsufficient = errors.New(`allowance insufficient`) )
var ( StateMappings = m.StateMappings{}. Add(&Allowance{}, m.PKeySchema(&AllowanceId{}), m.List(&Allowances{}), ) EventMappings = m.EventMappings{}. Add(&Approved{}). Add(&TransferredFrom{}) )
var AllowanceServiceSwagger []byte
var File_token_service_allowance_allowance_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAllowanceServiceChaincode ¶
func RegisterAllowanceServiceChaincode(r *cckit_router.Group, cc AllowanceServiceChaincode) error
RegisterAllowanceServiceChaincode registers service methods as chaincode router handlers
func RegisterAllowanceServiceHandler ¶
func RegisterAllowanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAllowanceServiceHandler registers the http handlers for service AllowanceService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAllowanceServiceHandlerClient ¶
func RegisterAllowanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AllowanceServiceClient) error
RegisterAllowanceServiceHandlerClient registers the http handlers for service AllowanceService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AllowanceServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AllowanceServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AllowanceServiceClient" to call the correct interceptors.
func RegisterAllowanceServiceHandlerFromEndpoint ¶
func RegisterAllowanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAllowanceServiceHandlerFromEndpoint is same as RegisterAllowanceServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAllowanceServiceHandlerServer ¶
func RegisterAllowanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AllowanceServiceServer) error
RegisterAllowanceServiceHandlerServer registers the http handlers for service AllowanceService to "mux". UnaryRPC :call AllowanceServiceServer 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 RegisterAllowanceServiceHandlerFromEndpoint instead.
func RegisterAllowanceServiceServer ¶
func RegisterAllowanceServiceServer(s *grpc.Server, srv AllowanceServiceServer)
Types ¶
type Allowance ¶
type Allowance struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
Allowance
func (*Allowance) Descriptor
deprecated
func (*Allowance) GetOwnerAddress ¶
func (*Allowance) GetSpenderAddress ¶
func (*Allowance) ProtoMessage ¶
func (*Allowance) ProtoMessage()
func (*Allowance) ProtoReflect ¶
func (x *Allowance) ProtoReflect() protoreflect.Message
type AllowanceId ¶
type AllowanceId struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
Allowance identifier
func (*AllowanceId) Descriptor
deprecated
func (*AllowanceId) Descriptor() ([]byte, []int)
Deprecated: Use AllowanceId.ProtoReflect.Descriptor instead.
func (*AllowanceId) GetOwnerAddress ¶
func (x *AllowanceId) GetOwnerAddress() string
func (*AllowanceId) GetSpenderAddress ¶
func (x *AllowanceId) GetSpenderAddress() string
func (*AllowanceId) GetToken ¶
func (x *AllowanceId) GetToken() []string
func (*AllowanceId) ProtoMessage ¶
func (*AllowanceId) ProtoMessage()
func (*AllowanceId) ProtoReflect ¶
func (x *AllowanceId) ProtoReflect() protoreflect.Message
func (*AllowanceId) Reset ¶
func (x *AllowanceId) Reset()
func (*AllowanceId) String ¶
func (x *AllowanceId) String() string
func (*AllowanceId) Validate ¶
func (this *AllowanceId) Validate() error
type AllowanceRequest ¶
type AllowanceRequest struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*AllowanceRequest) Descriptor
deprecated
func (*AllowanceRequest) Descriptor() ([]byte, []int)
Deprecated: Use AllowanceRequest.ProtoReflect.Descriptor instead.
func (*AllowanceRequest) GetOwnerAddress ¶
func (x *AllowanceRequest) GetOwnerAddress() string
func (*AllowanceRequest) GetSpenderAddress ¶
func (x *AllowanceRequest) GetSpenderAddress() string
func (*AllowanceRequest) GetToken ¶
func (x *AllowanceRequest) GetToken() []string
func (*AllowanceRequest) ProtoMessage ¶
func (*AllowanceRequest) ProtoMessage()
func (*AllowanceRequest) ProtoReflect ¶
func (x *AllowanceRequest) ProtoReflect() protoreflect.Message
func (*AllowanceRequest) Reset ¶
func (x *AllowanceRequest) Reset()
func (*AllowanceRequest) String ¶
func (x *AllowanceRequest) String() string
func (*AllowanceRequest) Validate ¶
func (this *AllowanceRequest) Validate() error
type AllowanceServiceChaincode ¶
type AllowanceServiceChaincode interface { GetAllowance(cckit_router.Context, *AllowanceRequest) (*Allowance, error) Approve(cckit_router.Context, *ApproveRequest) (*Allowance, error) TransferFrom(cckit_router.Context, *TransferFromRequest) (*TransferFromResponse, error) }
AllowanceServiceChaincode chaincode methods interface
type AllowanceServiceChaincodeLocalResolver ¶
type AllowanceServiceChaincodeLocalResolver struct {
// contains filtered or unexported fields
}
AllowanceServiceChaincodeResolver interface for service resolver
func NewAllowanceServiceChaincodeLocalResolver ¶
func NewAllowanceServiceChaincodeLocalResolver(service AllowanceServiceChaincode) *AllowanceServiceChaincodeLocalResolver
func (*AllowanceServiceChaincodeLocalResolver) Resolve ¶
func (r *AllowanceServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (AllowanceServiceChaincode, error)
type AllowanceServiceChaincodeLocatorResolver ¶
type AllowanceServiceChaincodeLocatorResolver struct {
// contains filtered or unexported fields
}
AllowanceServiceChaincodeResolver interface for service resolver
func NewAllowanceServiceChaincodeResolver ¶
func NewAllowanceServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *AllowanceServiceChaincodeLocatorResolver
func (*AllowanceServiceChaincodeLocatorResolver) Resolve ¶
func (r *AllowanceServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (AllowanceServiceChaincode, error)
type AllowanceServiceChaincodeResolver ¶
type AllowanceServiceChaincodeResolver interface {
Resolve(ctx cckit_router.Context) (AllowanceServiceChaincode, error)
}
AllowanceServiceChaincodeResolver interface for service resolver
type AllowanceServiceChaincodeStubInvoker ¶
type AllowanceServiceChaincodeStubInvoker struct {
Invoker cckit_gateway.ChaincodeStubInvoker
}
func NewAllowanceServiceChaincodeStubInvoker ¶
func NewAllowanceServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *AllowanceServiceChaincodeStubInvoker
func (*AllowanceServiceChaincodeStubInvoker) Approve ¶
func (c *AllowanceServiceChaincodeStubInvoker) Approve(ctx cckit_router.Context, in *ApproveRequest) (*Allowance, error)
func (*AllowanceServiceChaincodeStubInvoker) GetAllowance ¶
func (c *AllowanceServiceChaincodeStubInvoker) GetAllowance(ctx cckit_router.Context, in *AllowanceRequest) (*Allowance, error)
func (*AllowanceServiceChaincodeStubInvoker) TransferFrom ¶
func (c *AllowanceServiceChaincodeStubInvoker) TransferFrom(ctx cckit_router.Context, in *TransferFromRequest) (*TransferFromResponse, error)
type AllowanceServiceClient ¶
type AllowanceServiceClient interface { // Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transfersender. // This is zero by default. GetAllowance(ctx context.Context, in *AllowanceRequest, opts ...grpc.CallOption) (*Allowance, error) // Sets amount as the allowance of spender over the caller’s tokens. // Emits an ApprovalEvent Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*Allowance, error) // Moves amount tokens from sender to recipient using the allowance mechanism. // Amount is then deducted from the caller’s allowance. // Emits TransferEvent TransferFrom(ctx context.Context, in *TransferFromRequest, opts ...grpc.CallOption) (*TransferFromResponse, error) }
AllowanceServiceClient is the client API for AllowanceService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAllowanceServiceClient ¶
func NewAllowanceServiceClient(cc grpc.ClientConnInterface) AllowanceServiceClient
type AllowanceServiceGateway ¶
type AllowanceServiceGateway struct {
ChaincodeInstance cckit_gateway.ChaincodeInstance
}
gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )
func NewAllowanceServiceGateway ¶
func NewAllowanceServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *AllowanceServiceGateway
NewAllowanceServiceGateway creates gateway to access chaincode method via chaincode service
func NewAllowanceServiceGatewayFromInstance ¶
func NewAllowanceServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *AllowanceServiceGateway
func (*AllowanceServiceGateway) Approve ¶
func (c *AllowanceServiceGateway) Approve(ctx context.Context, in *ApproveRequest) (*Allowance, error)
func (*AllowanceServiceGateway) GetAllowance ¶
func (c *AllowanceServiceGateway) GetAllowance(ctx context.Context, in *AllowanceRequest) (*Allowance, error)
func (*AllowanceServiceGateway) Invoker ¶
func (c *AllowanceServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*AllowanceServiceGateway) ServiceDef ¶
func (c *AllowanceServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
func (*AllowanceServiceGateway) TransferFrom ¶
func (c *AllowanceServiceGateway) TransferFrom(ctx context.Context, in *TransferFromRequest) (*TransferFromResponse, error)
type AllowanceServiceServer ¶
type AllowanceServiceServer interface { // Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transfersender. // This is zero by default. GetAllowance(context.Context, *AllowanceRequest) (*Allowance, error) // Sets amount as the allowance of spender over the caller’s tokens. // Emits an ApprovalEvent Approve(context.Context, *ApproveRequest) (*Allowance, error) // Moves amount tokens from sender to recipient using the allowance mechanism. // Amount is then deducted from the caller’s allowance. // Emits TransferEvent TransferFrom(context.Context, *TransferFromRequest) (*TransferFromResponse, error) }
AllowanceServiceServer is the server API for AllowanceService service.
type Allowances ¶
type Allowances struct { Items []*Allowance `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*Allowances) Descriptor
deprecated
func (*Allowances) Descriptor() ([]byte, []int)
Deprecated: Use Allowances.ProtoReflect.Descriptor instead.
func (*Allowances) GetItems ¶
func (x *Allowances) GetItems() []*Allowance
func (*Allowances) ProtoMessage ¶
func (*Allowances) ProtoMessage()
func (*Allowances) ProtoReflect ¶
func (x *Allowances) ProtoReflect() protoreflect.Message
func (*Allowances) Reset ¶
func (x *Allowances) Reset()
func (*Allowances) String ¶
func (x *Allowances) String() string
func (*Allowances) Validate ¶
func (this *Allowances) Validate() error
type ApproveRequest ¶
type ApproveRequest struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` Token []string `protobuf:"bytes,4,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*ApproveRequest) Descriptor
deprecated
func (*ApproveRequest) Descriptor() ([]byte, []int)
Deprecated: Use ApproveRequest.ProtoReflect.Descriptor instead.
func (*ApproveRequest) GetAmount ¶
func (x *ApproveRequest) GetAmount() uint64
func (*ApproveRequest) GetOwnerAddress ¶
func (x *ApproveRequest) GetOwnerAddress() string
func (*ApproveRequest) GetSpenderAddress ¶
func (x *ApproveRequest) GetSpenderAddress() string
func (*ApproveRequest) GetToken ¶
func (x *ApproveRequest) GetToken() []string
func (*ApproveRequest) ProtoMessage ¶
func (*ApproveRequest) ProtoMessage()
func (*ApproveRequest) ProtoReflect ¶
func (x *ApproveRequest) ProtoReflect() protoreflect.Message
func (*ApproveRequest) Reset ¶
func (x *ApproveRequest) Reset()
func (*ApproveRequest) String ¶
func (x *ApproveRequest) String() string
func (*ApproveRequest) Validate ¶
func (this *ApproveRequest) Validate() error
type Approved ¶
type Approved struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
Approved event is emitted when Approve method has been invoked
func (*Approved) Descriptor
deprecated
func (*Approved) GetOwnerAddress ¶
func (*Approved) GetSpenderAddress ¶
func (*Approved) ProtoMessage ¶
func (*Approved) ProtoMessage()
func (*Approved) ProtoReflect ¶
func (x *Approved) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) GetAllowance ¶
func (*Service) TransferFrom ¶
func (s *Service) TransferFrom(ctx router.Context, req *TransferFromRequest) (*TransferFromResponse, error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
type TransferFromRequest ¶
type TransferFromRequest struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` RecipientAddress string `protobuf:"bytes,2,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` Token []string `protobuf:"bytes,4,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*TransferFromRequest) Descriptor
deprecated
func (*TransferFromRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferFromRequest.ProtoReflect.Descriptor instead.
func (*TransferFromRequest) GetAmount ¶
func (x *TransferFromRequest) GetAmount() uint64
func (*TransferFromRequest) GetOwnerAddress ¶
func (x *TransferFromRequest) GetOwnerAddress() string
func (*TransferFromRequest) GetRecipientAddress ¶
func (x *TransferFromRequest) GetRecipientAddress() string
func (*TransferFromRequest) GetToken ¶
func (x *TransferFromRequest) GetToken() []string
func (*TransferFromRequest) ProtoMessage ¶
func (*TransferFromRequest) ProtoMessage()
func (*TransferFromRequest) ProtoReflect ¶
func (x *TransferFromRequest) ProtoReflect() protoreflect.Message
func (*TransferFromRequest) Reset ¶
func (x *TransferFromRequest) Reset()
func (*TransferFromRequest) String ¶
func (x *TransferFromRequest) String() string
func (*TransferFromRequest) Validate ¶
func (this *TransferFromRequest) Validate() error
type TransferFromResponse ¶
type TransferFromResponse struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` RecipientAddress string `protobuf:"bytes,2,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
func (*TransferFromResponse) Descriptor
deprecated
func (*TransferFromResponse) Descriptor() ([]byte, []int)
Deprecated: Use TransferFromResponse.ProtoReflect.Descriptor instead.
func (*TransferFromResponse) GetAmount ¶
func (x *TransferFromResponse) GetAmount() uint64
func (*TransferFromResponse) GetOwnerAddress ¶
func (x *TransferFromResponse) GetOwnerAddress() string
func (*TransferFromResponse) GetRecipientAddress ¶
func (x *TransferFromResponse) GetRecipientAddress() string
func (*TransferFromResponse) GetToken ¶
func (x *TransferFromResponse) GetToken() []string
func (*TransferFromResponse) ProtoMessage ¶
func (*TransferFromResponse) ProtoMessage()
func (*TransferFromResponse) ProtoReflect ¶
func (x *TransferFromResponse) ProtoReflect() protoreflect.Message
func (*TransferFromResponse) Reset ¶
func (x *TransferFromResponse) Reset()
func (*TransferFromResponse) String ¶
func (x *TransferFromResponse) String() string
func (*TransferFromResponse) Validate ¶
func (this *TransferFromResponse) Validate() error
type TransferredFrom ¶
type TransferredFrom struct { OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` SpenderAddress string `protobuf:"bytes,2,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` RecipientAddress string `protobuf:"bytes,3,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` Token []string `protobuf:"bytes,4,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
TransferredFrom event is emitted when TransferFrom method has been invoked
func (*TransferredFrom) Descriptor
deprecated
func (*TransferredFrom) Descriptor() ([]byte, []int)
Deprecated: Use TransferredFrom.ProtoReflect.Descriptor instead.
func (*TransferredFrom) GetAmount ¶
func (x *TransferredFrom) GetAmount() uint64
func (*TransferredFrom) GetOwnerAddress ¶
func (x *TransferredFrom) GetOwnerAddress() string
func (*TransferredFrom) GetRecipientAddress ¶
func (x *TransferredFrom) GetRecipientAddress() string
func (*TransferredFrom) GetSpenderAddress ¶
func (x *TransferredFrom) GetSpenderAddress() string
func (*TransferredFrom) GetToken ¶
func (x *TransferredFrom) GetToken() []string
func (*TransferredFrom) ProtoMessage ¶
func (*TransferredFrom) ProtoMessage()
func (*TransferredFrom) ProtoReflect ¶
func (x *TransferredFrom) ProtoReflect() protoreflect.Message
func (*TransferredFrom) Reset ¶
func (x *TransferredFrom) Reset()
func (*TransferredFrom) String ¶
func (x *TransferredFrom) String() string
func (*TransferredFrom) Validate ¶
func (this *TransferredFrom) Validate() error
type UnimplementedAllowanceServiceServer ¶
type UnimplementedAllowanceServiceServer struct { }
UnimplementedAllowanceServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedAllowanceServiceServer) Approve ¶
func (*UnimplementedAllowanceServiceServer) Approve(context.Context, *ApproveRequest) (*Allowance, error)
func (*UnimplementedAllowanceServiceServer) GetAllowance ¶
func (*UnimplementedAllowanceServiceServer) GetAllowance(context.Context, *AllowanceRequest) (*Allowance, error)
func (*UnimplementedAllowanceServiceServer) TransferFrom ¶
func (*UnimplementedAllowanceServiceServer) TransferFrom(context.Context, *TransferFromRequest) (*TransferFromResponse, error)