Documentation
¶
Overview ¶
Package balance 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 balance is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func Event(ctx router.Context) state.Event
- func RegisterBalanceServiceChaincode(r *cckit_router.Group, cc BalanceServiceChaincode) error
- func RegisterBalanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBalanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BalanceServiceClient) error
- func RegisterBalanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBalanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BalanceServiceServer) error
- func RegisterBalanceServiceServer(s *grpc.Server, srv BalanceServiceServer)
- func State(ctx router.Context) m.MappedState
- type AddMetaRequest
- func (*AddMetaRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddMetaRequest) GetKey() string
- func (x *AddMetaRequest) GetValue() string
- func (*AddMetaRequest) ProtoMessage()
- func (x *AddMetaRequest) ProtoReflect() protoreflect.Message
- func (x *AddMetaRequest) Reset()
- func (x *AddMetaRequest) String() string
- func (this *AddMetaRequest) Validate() error
- type Balance
- func (*Balance) Descriptor() ([]byte, []int)deprecated
- func (x *Balance) GetAddress() string
- func (x *Balance) GetAmount() uint64
- func (x *Balance) GetToken() []string
- func (*Balance) ProtoMessage()
- func (x *Balance) ProtoReflect() protoreflect.Message
- func (x *Balance) Reset()
- func (x *Balance) String() string
- func (this *Balance) Validate() error
- type BalanceId
- func (*BalanceId) Descriptor() ([]byte, []int)deprecated
- func (x *BalanceId) GetAddress() string
- func (x *BalanceId) GetToken() []string
- func (*BalanceId) ProtoMessage()
- func (x *BalanceId) ProtoReflect() protoreflect.Message
- func (x *BalanceId) Reset()
- func (x *BalanceId) String() string
- func (this *BalanceId) Validate() error
- type BalanceOperation
- func (*BalanceOperation) Descriptor() ([]byte, []int)deprecated
- func (x *BalanceOperation) GetAmount() uint64
- func (x *BalanceOperation) GetRecipientAddress() string
- func (x *BalanceOperation) GetSenderAddress() string
- func (x *BalanceOperation) GetToken() []string
- func (*BalanceOperation) ProtoMessage()
- func (x *BalanceOperation) ProtoReflect() protoreflect.Message
- func (x *BalanceOperation) Reset()
- func (x *BalanceOperation) String() string
- func (this *BalanceOperation) Validate() error
- type BalanceOperationType
- func (BalanceOperationType) Descriptor() protoreflect.EnumDescriptor
- func (x BalanceOperationType) Enum() *BalanceOperationType
- func (BalanceOperationType) EnumDescriptor() ([]byte, []int)deprecated
- func (x BalanceOperationType) Number() protoreflect.EnumNumber
- func (x BalanceOperationType) String() string
- func (BalanceOperationType) Type() protoreflect.EnumType
- type BalanceServiceChaincode
- type BalanceServiceChaincodeLocalResolver
- type BalanceServiceChaincodeLocatorResolver
- type BalanceServiceChaincodeResolver
- type BalanceServiceChaincodeStubInvoker
- func (c *BalanceServiceChaincodeStubInvoker) GetBalance(ctx cckit_router.Context, in *GetBalanceRequest) (*Balance, error)
- func (c *BalanceServiceChaincodeStubInvoker) ListAddressBalances(ctx cckit_router.Context, in *ListAddressBalancesRequest) (*Balances, error)
- func (c *BalanceServiceChaincodeStubInvoker) ListBalances(ctx cckit_router.Context, in *emptypb.Empty) (*Balances, error)
- func (c *BalanceServiceChaincodeStubInvoker) Transfer(ctx cckit_router.Context, in *TransferRequest) (*TransferResponse, error)
- type BalanceServiceClient
- type BalanceServiceGateway
- func (c *BalanceServiceGateway) GetBalance(ctx context.Context, in *GetBalanceRequest) (*Balance, error)
- func (c *BalanceServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
- func (c *BalanceServiceGateway) ListAddressBalances(ctx context.Context, in *ListAddressBalancesRequest) (*Balances, error)
- func (c *BalanceServiceGateway) ListBalances(ctx context.Context, in *emptypb.Empty) (*Balances, error)
- func (c *BalanceServiceGateway) ServiceDef() cckit_gateway.ServiceDef
- func (c *BalanceServiceGateway) Transfer(ctx context.Context, in *TransferRequest) (*TransferResponse, error)
- type BalanceServiceServer
- type Balances
- type GetBalanceRequest
- func (*GetBalanceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBalanceRequest) GetAddress() string
- func (x *GetBalanceRequest) GetToken() []string
- func (*GetBalanceRequest) ProtoMessage()
- func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message
- func (x *GetBalanceRequest) Reset()
- func (x *GetBalanceRequest) String() string
- func (this *GetBalanceRequest) Validate() error
- type ListAddressBalancesRequest
- func (*ListAddressBalancesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListAddressBalancesRequest) GetAddress() string
- func (*ListAddressBalancesRequest) ProtoMessage()
- func (x *ListAddressBalancesRequest) ProtoReflect() protoreflect.Message
- func (x *ListAddressBalancesRequest) Reset()
- func (x *ListAddressBalancesRequest) String() string
- func (this *ListAddressBalancesRequest) Validate() error
- type Meta
- type Service
- func (s *Service) GetBalance(ctx router.Context, req *GetBalanceRequest) (*Balance, error)
- func (s *Service) ListAddressBalances(ctx router.Context, req *ListAddressBalancesRequest) (*Balances, error)
- func (s *Service) ListBalances(ctx router.Context, _ *emptypb.Empty) (*Balances, error)
- func (s *Service) Store(ctx router.Context) *Store
- func (s *Service) Transfer(ctx router.Context, req *TransferRequest) (*TransferResponse, error)
- type Store
- func (s *Store) Add(address string, token []string, amount uint64) error
- func (s *Store) Get(address string, token []string) (*Balance, error)
- func (s *Store) Sub(address string, token []string, amount uint64) error
- func (s *Store) Transfer(senderAddress, recipientAddress string, tokenId []string, amount uint64) error
- type TransferRequest
- func (*TransferRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferRequest) GetAmount() uint64
- func (x *TransferRequest) GetMeta() []*AddMetaRequest
- func (x *TransferRequest) GetRecipientAddress() string
- func (x *TransferRequest) GetToken() []string
- func (*TransferRequest) ProtoMessage()
- func (x *TransferRequest) ProtoReflect() protoreflect.Message
- func (x *TransferRequest) Reset()
- func (x *TransferRequest) String() string
- func (this *TransferRequest) Validate() error
- type TransferResponse
- func (*TransferResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TransferResponse) GetAmount() uint64
- func (x *TransferResponse) GetMeta() []*Meta
- func (x *TransferResponse) GetRecipientAddress() string
- func (x *TransferResponse) GetSenderAddress() string
- func (x *TransferResponse) GetToken() []string
- func (*TransferResponse) ProtoMessage()
- func (x *TransferResponse) ProtoReflect() protoreflect.Message
- func (x *TransferResponse) Reset()
- func (x *TransferResponse) String() string
- func (this *TransferResponse) Validate() error
- type Transferred
- func (*Transferred) Descriptor() ([]byte, []int)deprecated
- func (x *Transferred) GetAmount() uint64
- func (x *Transferred) GetMeta() []*Meta
- func (x *Transferred) GetRecipientAddress() string
- func (x *Transferred) GetSenderAddress() string
- func (x *Transferred) GetToken() []string
- func (*Transferred) ProtoMessage()
- func (x *Transferred) ProtoReflect() protoreflect.Message
- func (x *Transferred) Reset()
- func (x *Transferred) String() string
- func (this *Transferred) Validate() error
- type UnimplementedBalanceServiceServer
- func (*UnimplementedBalanceServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*Balance, error)
- func (*UnimplementedBalanceServiceServer) ListAddressBalances(context.Context, *ListAddressBalancesRequest) (*Balances, error)
- func (*UnimplementedBalanceServiceServer) ListBalances(context.Context, *emptypb.Empty) (*Balances, error)
- func (*UnimplementedBalanceServiceServer) Transfer(context.Context, *TransferRequest) (*TransferResponse, error)
Constants ¶
const ( // BalanceServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode BalanceServiceChaincodeMethodPrefix = "" BalanceServiceChaincode_GetBalance = BalanceServiceChaincodeMethodPrefix + "GetBalance" BalanceServiceChaincode_ListBalances = BalanceServiceChaincodeMethodPrefix + "ListBalances" BalanceServiceChaincode_ListAddressBalances = BalanceServiceChaincodeMethodPrefix + "ListAddressBalances" BalanceServiceChaincode_Transfer = BalanceServiceChaincodeMethodPrefix + "Transfer" )
BalanceServiceChaincode method names
Variables ¶
var ( BalanceOperationType_name = map[int32]string{ 0: "BALANCE_OPERATION_UNKNOWN", 1: "BALANCE_OPERATION_SET", 2: "BALANCE_OPERATION_ADD", 3: "BALANCE_OPERATION_SUB", 4: "BALANCE_OPERATION_TRANSFER", } BalanceOperationType_value = map[string]int32{ "BALANCE_OPERATION_UNKNOWN": 0, "BALANCE_OPERATION_SET": 1, "BALANCE_OPERATION_ADD": 2, "BALANCE_OPERATION_SUB": 3, "BALANCE_OPERATION_TRANSFER": 4, } )
Enum value maps for BalanceOperationType.
var ( ErrAmountInsuficcient = errors.New(`amount insufficient`) StateMappings = m.StateMappings{}. Add(&Balance{}, m.PKeySchema(&BalanceId{}), m.List(&Balances{}), ) EventMappings = m.EventMappings{}. Add(&Transferred{}) )
var BalanceServiceSwagger []byte
var File_token_service_balance_balance_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBalanceServiceChaincode ¶
func RegisterBalanceServiceChaincode(r *cckit_router.Group, cc BalanceServiceChaincode) error
RegisterBalanceServiceChaincode registers service methods as chaincode router handlers
func RegisterBalanceServiceHandler ¶
func RegisterBalanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBalanceServiceHandler registers the http handlers for service BalanceService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBalanceServiceHandlerClient ¶
func RegisterBalanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BalanceServiceClient) error
RegisterBalanceServiceHandlerClient registers the http handlers for service BalanceService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BalanceServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BalanceServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BalanceServiceClient" to call the correct interceptors.
func RegisterBalanceServiceHandlerFromEndpoint ¶
func RegisterBalanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBalanceServiceHandlerFromEndpoint is same as RegisterBalanceServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBalanceServiceHandlerServer ¶
func RegisterBalanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BalanceServiceServer) error
RegisterBalanceServiceHandlerServer registers the http handlers for service BalanceService to "mux". UnaryRPC :call BalanceServiceServer 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 RegisterBalanceServiceHandlerFromEndpoint instead.
func RegisterBalanceServiceServer ¶
func RegisterBalanceServiceServer(s *grpc.Server, srv BalanceServiceServer)
Types ¶
type AddMetaRequest ¶
type AddMetaRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*AddMetaRequest) Descriptor
deprecated
func (*AddMetaRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddMetaRequest.ProtoReflect.Descriptor instead.
func (*AddMetaRequest) GetKey ¶
func (x *AddMetaRequest) GetKey() string
func (*AddMetaRequest) GetValue ¶
func (x *AddMetaRequest) GetValue() string
func (*AddMetaRequest) ProtoMessage ¶
func (*AddMetaRequest) ProtoMessage()
func (*AddMetaRequest) ProtoReflect ¶
func (x *AddMetaRequest) ProtoReflect() protoreflect.Message
func (*AddMetaRequest) Reset ¶
func (x *AddMetaRequest) Reset()
func (*AddMetaRequest) String ¶
func (x *AddMetaRequest) String() string
func (*AddMetaRequest) Validate ¶
func (this *AddMetaRequest) Validate() error
type Balance ¶
type Balance struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Token []string `protobuf:"bytes,2,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
Balance
func (*Balance) Descriptor
deprecated
func (*Balance) GetAddress ¶
func (*Balance) ProtoMessage ¶
func (*Balance) ProtoMessage()
func (*Balance) ProtoReflect ¶
func (x *Balance) ProtoReflect() protoreflect.Message
type BalanceId ¶
type BalanceId struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Token []string `protobuf:"bytes,2,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
Balance identifier
func (*BalanceId) Descriptor
deprecated
func (*BalanceId) GetAddress ¶
func (*BalanceId) ProtoMessage ¶
func (*BalanceId) ProtoMessage()
func (*BalanceId) ProtoReflect ¶
func (x *BalanceId) ProtoReflect() protoreflect.Message
type BalanceOperation ¶
type BalanceOperation struct { SenderAddress string `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_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 (*BalanceOperation) Descriptor
deprecated
func (*BalanceOperation) Descriptor() ([]byte, []int)
Deprecated: Use BalanceOperation.ProtoReflect.Descriptor instead.
func (*BalanceOperation) GetAmount ¶
func (x *BalanceOperation) GetAmount() uint64
func (*BalanceOperation) GetRecipientAddress ¶
func (x *BalanceOperation) GetRecipientAddress() string
func (*BalanceOperation) GetSenderAddress ¶
func (x *BalanceOperation) GetSenderAddress() string
func (*BalanceOperation) GetToken ¶
func (x *BalanceOperation) GetToken() []string
func (*BalanceOperation) ProtoMessage ¶
func (*BalanceOperation) ProtoMessage()
func (*BalanceOperation) ProtoReflect ¶
func (x *BalanceOperation) ProtoReflect() protoreflect.Message
func (*BalanceOperation) Reset ¶
func (x *BalanceOperation) Reset()
func (*BalanceOperation) String ¶
func (x *BalanceOperation) String() string
func (*BalanceOperation) Validate ¶
func (this *BalanceOperation) Validate() error
type BalanceOperationType ¶
type BalanceOperationType int32
const ( BalanceOperationType_BALANCE_OPERATION_UNKNOWN BalanceOperationType = 0 BalanceOperationType_BALANCE_OPERATION_SET BalanceOperationType = 1 BalanceOperationType_BALANCE_OPERATION_ADD BalanceOperationType = 2 BalanceOperationType_BALANCE_OPERATION_SUB BalanceOperationType = 3 BalanceOperationType_BALANCE_OPERATION_TRANSFER BalanceOperationType = 4 )
func (BalanceOperationType) Descriptor ¶
func (BalanceOperationType) Descriptor() protoreflect.EnumDescriptor
func (BalanceOperationType) Enum ¶
func (x BalanceOperationType) Enum() *BalanceOperationType
func (BalanceOperationType) EnumDescriptor
deprecated
func (BalanceOperationType) EnumDescriptor() ([]byte, []int)
Deprecated: Use BalanceOperationType.Descriptor instead.
func (BalanceOperationType) Number ¶
func (x BalanceOperationType) Number() protoreflect.EnumNumber
func (BalanceOperationType) String ¶
func (x BalanceOperationType) String() string
func (BalanceOperationType) Type ¶
func (BalanceOperationType) Type() protoreflect.EnumType
type BalanceServiceChaincode ¶
type BalanceServiceChaincode interface { GetBalance(cckit_router.Context, *GetBalanceRequest) (*Balance, error) ListBalances(cckit_router.Context, *emptypb.Empty) (*Balances, error) ListAddressBalances(cckit_router.Context, *ListAddressBalancesRequest) (*Balances, error) Transfer(cckit_router.Context, *TransferRequest) (*TransferResponse, error) }
BalanceServiceChaincode chaincode methods interface
type BalanceServiceChaincodeLocalResolver ¶
type BalanceServiceChaincodeLocalResolver struct {
// contains filtered or unexported fields
}
BalanceServiceChaincodeResolver interface for service resolver
func NewBalanceServiceChaincodeLocalResolver ¶
func NewBalanceServiceChaincodeLocalResolver(service BalanceServiceChaincode) *BalanceServiceChaincodeLocalResolver
func (*BalanceServiceChaincodeLocalResolver) Resolve ¶
func (r *BalanceServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (BalanceServiceChaincode, error)
type BalanceServiceChaincodeLocatorResolver ¶
type BalanceServiceChaincodeLocatorResolver struct {
// contains filtered or unexported fields
}
BalanceServiceChaincodeResolver interface for service resolver
func NewBalanceServiceChaincodeResolver ¶
func NewBalanceServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *BalanceServiceChaincodeLocatorResolver
func (*BalanceServiceChaincodeLocatorResolver) Resolve ¶
func (r *BalanceServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (BalanceServiceChaincode, error)
type BalanceServiceChaincodeResolver ¶
type BalanceServiceChaincodeResolver interface {
Resolve(ctx cckit_router.Context) (BalanceServiceChaincode, error)
}
BalanceServiceChaincodeResolver interface for service resolver
type BalanceServiceChaincodeStubInvoker ¶
type BalanceServiceChaincodeStubInvoker struct {
Invoker cckit_gateway.ChaincodeStubInvoker
}
func NewBalanceServiceChaincodeStubInvoker ¶
func NewBalanceServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *BalanceServiceChaincodeStubInvoker
func (*BalanceServiceChaincodeStubInvoker) GetBalance ¶
func (c *BalanceServiceChaincodeStubInvoker) GetBalance(ctx cckit_router.Context, in *GetBalanceRequest) (*Balance, error)
func (*BalanceServiceChaincodeStubInvoker) ListAddressBalances ¶
func (c *BalanceServiceChaincodeStubInvoker) ListAddressBalances(ctx cckit_router.Context, in *ListAddressBalancesRequest) (*Balances, error)
func (*BalanceServiceChaincodeStubInvoker) ListBalances ¶
func (c *BalanceServiceChaincodeStubInvoker) ListBalances(ctx cckit_router.Context, in *emptypb.Empty) (*Balances, error)
func (*BalanceServiceChaincodeStubInvoker) Transfer ¶
func (c *BalanceServiceChaincodeStubInvoker) Transfer(ctx cckit_router.Context, in *TransferRequest) (*TransferResponse, error)
type BalanceServiceClient ¶
type BalanceServiceClient interface { // Returns the amount of tokens owned by account. GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*Balance, error) ListBalances(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Balances, error) ListAddressBalances(ctx context.Context, in *ListAddressBalancesRequest, opts ...grpc.CallOption) (*Balances, error) // Moves amount tokens from the caller’s account to recipient. // Returns transfer details Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) }
BalanceServiceClient is the client API for BalanceService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBalanceServiceClient ¶
func NewBalanceServiceClient(cc grpc.ClientConnInterface) BalanceServiceClient
type BalanceServiceGateway ¶
type BalanceServiceGateway 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 NewBalanceServiceGateway ¶
func NewBalanceServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *BalanceServiceGateway
NewBalanceServiceGateway creates gateway to access chaincode method via chaincode service
func NewBalanceServiceGatewayFromInstance ¶
func NewBalanceServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *BalanceServiceGateway
func (*BalanceServiceGateway) GetBalance ¶
func (c *BalanceServiceGateway) GetBalance(ctx context.Context, in *GetBalanceRequest) (*Balance, error)
func (*BalanceServiceGateway) Invoker ¶
func (c *BalanceServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*BalanceServiceGateway) ListAddressBalances ¶
func (c *BalanceServiceGateway) ListAddressBalances(ctx context.Context, in *ListAddressBalancesRequest) (*Balances, error)
func (*BalanceServiceGateway) ListBalances ¶
func (*BalanceServiceGateway) ServiceDef ¶
func (c *BalanceServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
func (*BalanceServiceGateway) Transfer ¶
func (c *BalanceServiceGateway) Transfer(ctx context.Context, in *TransferRequest) (*TransferResponse, error)
type BalanceServiceServer ¶
type BalanceServiceServer interface { // Returns the amount of tokens owned by account. GetBalance(context.Context, *GetBalanceRequest) (*Balance, error) ListBalances(context.Context, *emptypb.Empty) (*Balances, error) ListAddressBalances(context.Context, *ListAddressBalancesRequest) (*Balances, error) // Moves amount tokens from the caller’s account to recipient. // Returns transfer details Transfer(context.Context, *TransferRequest) (*TransferResponse, error) }
BalanceServiceServer is the server API for BalanceService service.
type Balances ¶
type Balances struct { Items []*Balance `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
List
func (*Balances) Descriptor
deprecated
func (*Balances) ProtoMessage ¶
func (*Balances) ProtoMessage()
func (*Balances) ProtoReflect ¶
func (x *Balances) ProtoReflect() protoreflect.Message
type GetBalanceRequest ¶
type GetBalanceRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Token []string `protobuf:"bytes,2,rep,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*GetBalanceRequest) Descriptor
deprecated
func (*GetBalanceRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBalanceRequest.ProtoReflect.Descriptor instead.
func (*GetBalanceRequest) GetAddress ¶
func (x *GetBalanceRequest) GetAddress() string
func (*GetBalanceRequest) GetToken ¶
func (x *GetBalanceRequest) GetToken() []string
func (*GetBalanceRequest) ProtoMessage ¶
func (*GetBalanceRequest) ProtoMessage()
func (*GetBalanceRequest) ProtoReflect ¶
func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message
func (*GetBalanceRequest) Reset ¶
func (x *GetBalanceRequest) Reset()
func (*GetBalanceRequest) String ¶
func (x *GetBalanceRequest) String() string
func (*GetBalanceRequest) Validate ¶
func (this *GetBalanceRequest) Validate() error
type ListAddressBalancesRequest ¶
type ListAddressBalancesRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
func (*ListAddressBalancesRequest) Descriptor
deprecated
func (*ListAddressBalancesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListAddressBalancesRequest.ProtoReflect.Descriptor instead.
func (*ListAddressBalancesRequest) GetAddress ¶
func (x *ListAddressBalancesRequest) GetAddress() string
func (*ListAddressBalancesRequest) ProtoMessage ¶
func (*ListAddressBalancesRequest) ProtoMessage()
func (*ListAddressBalancesRequest) ProtoReflect ¶
func (x *ListAddressBalancesRequest) ProtoReflect() protoreflect.Message
func (*ListAddressBalancesRequest) Reset ¶
func (x *ListAddressBalancesRequest) Reset()
func (*ListAddressBalancesRequest) String ¶
func (x *ListAddressBalancesRequest) String() string
func (*ListAddressBalancesRequest) Validate ¶
func (this *ListAddressBalancesRequest) Validate() error
type Meta ¶
type Meta struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Meta) Descriptor
deprecated
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct { Account account.Getter Token config.TokenGetter }
func (*Service) GetBalance ¶
func (*Service) ListAddressBalances ¶
func (*Service) ListBalances ¶
func (*Service) Transfer ¶
func (s *Service) Transfer(ctx router.Context, req *TransferRequest) (*TransferResponse, error)
type TransferRequest ¶
type TransferRequest struct { RecipientAddress string `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` Token []string `protobuf:"bytes,2,rep,name=token,proto3" json:"token,omitempty"` Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` Meta []*AddMetaRequest `protobuf:"bytes,4,rep,name=meta,proto3" json:"meta,omitempty"` // contains filtered or unexported fields }
func (*TransferRequest) Descriptor
deprecated
func (*TransferRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead.
func (*TransferRequest) GetAmount ¶
func (x *TransferRequest) GetAmount() uint64
func (*TransferRequest) GetMeta ¶
func (x *TransferRequest) GetMeta() []*AddMetaRequest
func (*TransferRequest) GetRecipientAddress ¶
func (x *TransferRequest) GetRecipientAddress() string
func (*TransferRequest) GetToken ¶
func (x *TransferRequest) GetToken() []string
func (*TransferRequest) ProtoMessage ¶
func (*TransferRequest) ProtoMessage()
func (*TransferRequest) ProtoReflect ¶
func (x *TransferRequest) ProtoReflect() protoreflect.Message
func (*TransferRequest) Reset ¶
func (x *TransferRequest) Reset()
func (*TransferRequest) String ¶
func (x *TransferRequest) String() string
func (*TransferRequest) Validate ¶
func (this *TransferRequest) Validate() error
type TransferResponse ¶
type TransferResponse struct { SenderAddress string `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_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"` Meta []*Meta `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` // contains filtered or unexported fields }
func (*TransferResponse) Descriptor
deprecated
func (*TransferResponse) Descriptor() ([]byte, []int)
Deprecated: Use TransferResponse.ProtoReflect.Descriptor instead.
func (*TransferResponse) GetAmount ¶
func (x *TransferResponse) GetAmount() uint64
func (*TransferResponse) GetMeta ¶
func (x *TransferResponse) GetMeta() []*Meta
func (*TransferResponse) GetRecipientAddress ¶
func (x *TransferResponse) GetRecipientAddress() string
func (*TransferResponse) GetSenderAddress ¶
func (x *TransferResponse) GetSenderAddress() string
func (*TransferResponse) GetToken ¶
func (x *TransferResponse) GetToken() []string
func (*TransferResponse) ProtoMessage ¶
func (*TransferResponse) ProtoMessage()
func (*TransferResponse) ProtoReflect ¶
func (x *TransferResponse) ProtoReflect() protoreflect.Message
func (*TransferResponse) Reset ¶
func (x *TransferResponse) Reset()
func (*TransferResponse) String ¶
func (x *TransferResponse) String() string
func (*TransferResponse) Validate ¶
func (this *TransferResponse) Validate() error
type Transferred ¶
type Transferred struct { SenderAddress string `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_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"` Meta []*Meta `protobuf:"bytes,5,rep,name=meta,proto3" json:"meta,omitempty"` // contains filtered or unexported fields }
Transferred event is emitted when Transfer method has been invoked
func (*Transferred) Descriptor
deprecated
func (*Transferred) Descriptor() ([]byte, []int)
Deprecated: Use Transferred.ProtoReflect.Descriptor instead.
func (*Transferred) GetAmount ¶
func (x *Transferred) GetAmount() uint64
func (*Transferred) GetMeta ¶
func (x *Transferred) GetMeta() []*Meta
func (*Transferred) GetRecipientAddress ¶
func (x *Transferred) GetRecipientAddress() string
func (*Transferred) GetSenderAddress ¶
func (x *Transferred) GetSenderAddress() string
func (*Transferred) GetToken ¶
func (x *Transferred) GetToken() []string
func (*Transferred) ProtoMessage ¶
func (*Transferred) ProtoMessage()
func (*Transferred) ProtoReflect ¶
func (x *Transferred) ProtoReflect() protoreflect.Message
func (*Transferred) Reset ¶
func (x *Transferred) Reset()
func (*Transferred) String ¶
func (x *Transferred) String() string
func (*Transferred) Validate ¶
func (this *Transferred) Validate() error
type UnimplementedBalanceServiceServer ¶
type UnimplementedBalanceServiceServer struct { }
UnimplementedBalanceServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedBalanceServiceServer) GetBalance ¶
func (*UnimplementedBalanceServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*Balance, error)
func (*UnimplementedBalanceServiceServer) ListAddressBalances ¶
func (*UnimplementedBalanceServiceServer) ListAddressBalances(context.Context, *ListAddressBalancesRequest) (*Balances, error)
func (*UnimplementedBalanceServiceServer) ListBalances ¶
func (*UnimplementedBalanceServiceServer) Transfer ¶
func (*UnimplementedBalanceServiceServer) Transfer(context.Context, *TransferRequest) (*TransferResponse, error)