Documentation
¶
Index ¶
- Variables
- func RegisterBalanceServer(s grpc.ServiceRegistrar, srv BalanceServer)
- type BalanceClient
- type BalanceServer
- type GetBalancesRequest
- func (*GetBalancesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBalancesRequest) GetCurrencyCodes() []string
- func (x *GetBalancesRequest) GetExcludePerMintBalances() bool
- func (x *GetBalancesRequest) GetMints() []*v1.SolanaAccountId
- func (x *GetBalancesRequest) GetOwners() []*v1.SolanaAccountId
- func (*GetBalancesRequest) ProtoMessage()
- func (x *GetBalancesRequest) ProtoReflect() protoreflect.Message
- func (x *GetBalancesRequest) Reset()
- func (x *GetBalancesRequest) String() string
- func (m *GetBalancesRequest) Validate() error
- type GetBalancesRequestValidationError
- func (e GetBalancesRequestValidationError) Cause() error
- func (e GetBalancesRequestValidationError) Error() string
- func (e GetBalancesRequestValidationError) ErrorName() string
- func (e GetBalancesRequestValidationError) Field() string
- func (e GetBalancesRequestValidationError) Key() bool
- func (e GetBalancesRequestValidationError) Reason() string
- type GetBalancesResponse
- func (*GetBalancesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBalancesResponse) GetBalancesByOwner() map[string]*OwnerBalance
- func (x *GetBalancesResponse) GetResult() GetBalancesResponse_Result
- func (*GetBalancesResponse) ProtoMessage()
- func (x *GetBalancesResponse) ProtoReflect() protoreflect.Message
- func (x *GetBalancesResponse) Reset()
- func (x *GetBalancesResponse) String() string
- func (m *GetBalancesResponse) Validate() error
- type GetBalancesResponseValidationError
- func (e GetBalancesResponseValidationError) Cause() error
- func (e GetBalancesResponseValidationError) Error() string
- func (e GetBalancesResponseValidationError) ErrorName() string
- func (e GetBalancesResponseValidationError) Field() string
- func (e GetBalancesResponseValidationError) Key() bool
- func (e GetBalancesResponseValidationError) Reason() string
- type GetBalancesResponse_Result
- func (GetBalancesResponse_Result) Descriptor() protoreflect.EnumDescriptor
- func (x GetBalancesResponse_Result) Enum() *GetBalancesResponse_Result
- func (GetBalancesResponse_Result) EnumDescriptor() ([]byte, []int)deprecated
- func (x GetBalancesResponse_Result) Number() protoreflect.EnumNumber
- func (x GetBalancesResponse_Result) String() string
- func (GetBalancesResponse_Result) Type() protoreflect.EnumType
- type MintBalance
- func (*MintBalance) Descriptor() ([]byte, []int)deprecated
- func (x *MintBalance) GetCoreMintValue() uint64
- func (x *MintBalance) GetFiatValuesByCurrency() map[string]float64
- func (x *MintBalance) GetMint() *v1.SolanaAccountId
- func (x *MintBalance) GetQuarks() uint64
- func (*MintBalance) ProtoMessage()
- func (x *MintBalance) ProtoReflect() protoreflect.Message
- func (x *MintBalance) Reset()
- func (x *MintBalance) String() string
- func (m *MintBalance) Validate() error
- type MintBalanceValidationError
- func (e MintBalanceValidationError) Cause() error
- func (e MintBalanceValidationError) Error() string
- func (e MintBalanceValidationError) ErrorName() string
- func (e MintBalanceValidationError) Field() string
- func (e MintBalanceValidationError) Key() bool
- func (e MintBalanceValidationError) Reason() string
- type OwnerBalance
- func (*OwnerBalance) Descriptor() ([]byte, []int)deprecated
- func (x *OwnerBalance) GetBalancesByMint() map[string]*MintBalance
- func (x *OwnerBalance) GetCoreMintValue() uint64
- func (x *OwnerBalance) GetFiatValuesByCurrency() map[string]float64
- func (x *OwnerBalance) GetOwner() *v1.SolanaAccountId
- func (*OwnerBalance) ProtoMessage()
- func (x *OwnerBalance) ProtoReflect() protoreflect.Message
- func (x *OwnerBalance) Reset()
- func (x *OwnerBalance) String() string
- func (m *OwnerBalance) Validate() error
- type OwnerBalanceValidationError
- func (e OwnerBalanceValidationError) Cause() error
- func (e OwnerBalanceValidationError) Error() string
- func (e OwnerBalanceValidationError) ErrorName() string
- func (e OwnerBalanceValidationError) Field() string
- func (e OwnerBalanceValidationError) Key() bool
- func (e OwnerBalanceValidationError) Reason() string
- type UnimplementedBalanceServer
- type UnsafeBalanceServer
Constants ¶
This section is empty.
Variables ¶
var ( GetBalancesResponse_Result_name = map[int32]string{ 0: "OK", 1: "DENIED", } GetBalancesResponse_Result_value = map[string]int32{ "OK": 0, "DENIED": 1, } )
Enum value maps for GetBalancesResponse_Result.
var Balance_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ocp.balance.v1.Balance", HandlerType: (*BalanceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetBalances", Handler: _Balance_GetBalances_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "balance/v1/ocp_balance_service.proto", }
Balance_ServiceDesc is the grpc.ServiceDesc for Balance service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_balance_v1_ocp_balance_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBalanceServer ¶
func RegisterBalanceServer(s grpc.ServiceRegistrar, srv BalanceServer)
Types ¶
type BalanceClient ¶
type BalanceClient interface {
// GetBalances returns balance data for a set of owner accounts, optionally
// filtered by a set of mints. Balances are always denominated in the core
// mint, and can additionally be denominated in a set of fiat currencies.
GetBalances(ctx context.Context, in *GetBalancesRequest, opts ...grpc.CallOption) (*GetBalancesResponse, error)
}
BalanceClient is the client API for Balance 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.
func NewBalanceClient ¶
func NewBalanceClient(cc grpc.ClientConnInterface) BalanceClient
type BalanceServer ¶
type BalanceServer interface {
// GetBalances returns balance data for a set of owner accounts, optionally
// filtered by a set of mints. Balances are always denominated in the core
// mint, and can additionally be denominated in a set of fiat currencies.
GetBalances(context.Context, *GetBalancesRequest) (*GetBalancesResponse, error)
// contains filtered or unexported methods
}
BalanceServer is the server API for Balance service. All implementations must embed UnimplementedBalanceServer for forward compatibility
type GetBalancesRequest ¶ added in v1.17.0
type GetBalancesRequest struct {
// The owner accounts to fetch balances for
Owners []*v1.SolanaAccountId `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty"`
// Optional filter to limit the response to balances for the provided mints.
// When empty, balances for all mints held by each owner are returned.
Mints []*v1.SolanaAccountId `protobuf:"bytes,2,rep,name=mints,proto3" json:"mints,omitempty"`
// Optional set of ISO 4217 alpha-3 currency codes (e.g., "usd") to also
// denominate balance values in, in addition to the core mint value. When
// empty, only core mint values are returned.
CurrencyCodes []string `protobuf:"bytes,3,rep,name=currency_codes,json=currencyCodes,proto3" json:"currency_codes,omitempty"`
// When true, OwnerBalance.balances_by_mint is not populated. Owner totals
// are unaffected and still account for every mint matching the mints filter.
ExcludePerMintBalances bool `` /* 132-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetBalancesRequest) Descriptor
deprecated
added in
v1.17.0
func (*GetBalancesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBalancesRequest.ProtoReflect.Descriptor instead.
func (*GetBalancesRequest) GetCurrencyCodes ¶ added in v1.17.0
func (x *GetBalancesRequest) GetCurrencyCodes() []string
func (*GetBalancesRequest) GetExcludePerMintBalances ¶ added in v1.18.0
func (x *GetBalancesRequest) GetExcludePerMintBalances() bool
func (*GetBalancesRequest) GetMints ¶ added in v1.17.0
func (x *GetBalancesRequest) GetMints() []*v1.SolanaAccountId
func (*GetBalancesRequest) GetOwners ¶ added in v1.17.0
func (x *GetBalancesRequest) GetOwners() []*v1.SolanaAccountId
func (*GetBalancesRequest) ProtoMessage ¶ added in v1.17.0
func (*GetBalancesRequest) ProtoMessage()
func (*GetBalancesRequest) ProtoReflect ¶ added in v1.17.0
func (x *GetBalancesRequest) ProtoReflect() protoreflect.Message
func (*GetBalancesRequest) Reset ¶ added in v1.17.0
func (x *GetBalancesRequest) Reset()
func (*GetBalancesRequest) String ¶ added in v1.17.0
func (x *GetBalancesRequest) String() string
func (*GetBalancesRequest) Validate ¶ added in v1.17.0
func (m *GetBalancesRequest) Validate() error
Validate checks the field values on GetBalancesRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetBalancesRequestValidationError ¶ added in v1.17.0
type GetBalancesRequestValidationError struct {
// contains filtered or unexported fields
}
GetBalancesRequestValidationError is the validation error returned by GetBalancesRequest.Validate if the designated constraints aren't met.
func (GetBalancesRequestValidationError) Cause ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) Cause() error
Cause function returns cause value.
func (GetBalancesRequestValidationError) Error ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetBalancesRequestValidationError) ErrorName ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetBalancesRequestValidationError) Field ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) Field() string
Field function returns field value.
func (GetBalancesRequestValidationError) Key ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) Key() bool
Key function returns key value.
func (GetBalancesRequestValidationError) Reason ¶ added in v1.17.0
func (e GetBalancesRequestValidationError) Reason() string
Reason function returns reason value.
type GetBalancesResponse ¶ added in v1.17.0
type GetBalancesResponse struct {
Result GetBalancesResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=ocp.balance.v1.GetBalancesResponse_Result" json:"result,omitempty"`
// Individual owner balances keyed by owner address
BalancesByOwner map[string]*OwnerBalance `` /* 196-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetBalancesResponse) Descriptor
deprecated
added in
v1.17.0
func (*GetBalancesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBalancesResponse.ProtoReflect.Descriptor instead.
func (*GetBalancesResponse) GetBalancesByOwner ¶ added in v1.17.0
func (x *GetBalancesResponse) GetBalancesByOwner() map[string]*OwnerBalance
func (*GetBalancesResponse) GetResult ¶ added in v1.17.0
func (x *GetBalancesResponse) GetResult() GetBalancesResponse_Result
func (*GetBalancesResponse) ProtoMessage ¶ added in v1.17.0
func (*GetBalancesResponse) ProtoMessage()
func (*GetBalancesResponse) ProtoReflect ¶ added in v1.17.0
func (x *GetBalancesResponse) ProtoReflect() protoreflect.Message
func (*GetBalancesResponse) Reset ¶ added in v1.17.0
func (x *GetBalancesResponse) Reset()
func (*GetBalancesResponse) String ¶ added in v1.17.0
func (x *GetBalancesResponse) String() string
func (*GetBalancesResponse) Validate ¶ added in v1.17.0
func (m *GetBalancesResponse) Validate() error
Validate checks the field values on GetBalancesResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetBalancesResponseValidationError ¶ added in v1.17.0
type GetBalancesResponseValidationError struct {
// contains filtered or unexported fields
}
GetBalancesResponseValidationError is the validation error returned by GetBalancesResponse.Validate if the designated constraints aren't met.
func (GetBalancesResponseValidationError) Cause ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) Cause() error
Cause function returns cause value.
func (GetBalancesResponseValidationError) Error ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetBalancesResponseValidationError) ErrorName ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetBalancesResponseValidationError) Field ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) Field() string
Field function returns field value.
func (GetBalancesResponseValidationError) Key ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) Key() bool
Key function returns key value.
func (GetBalancesResponseValidationError) Reason ¶ added in v1.17.0
func (e GetBalancesResponseValidationError) Reason() string
Reason function returns reason value.
type GetBalancesResponse_Result ¶ added in v1.17.0
type GetBalancesResponse_Result int32
const ( GetBalancesResponse_OK GetBalancesResponse_Result = 0 GetBalancesResponse_DENIED GetBalancesResponse_Result = 1 )
func (GetBalancesResponse_Result) Descriptor ¶ added in v1.17.0
func (GetBalancesResponse_Result) Descriptor() protoreflect.EnumDescriptor
func (GetBalancesResponse_Result) Enum ¶ added in v1.17.0
func (x GetBalancesResponse_Result) Enum() *GetBalancesResponse_Result
func (GetBalancesResponse_Result) EnumDescriptor
deprecated
added in
v1.17.0
func (GetBalancesResponse_Result) EnumDescriptor() ([]byte, []int)
Deprecated: Use GetBalancesResponse_Result.Descriptor instead.
func (GetBalancesResponse_Result) Number ¶ added in v1.17.0
func (x GetBalancesResponse_Result) Number() protoreflect.EnumNumber
func (GetBalancesResponse_Result) String ¶ added in v1.17.0
func (x GetBalancesResponse_Result) String() string
func (GetBalancesResponse_Result) Type ¶ added in v1.17.0
func (GetBalancesResponse_Result) Type() protoreflect.EnumType
type MintBalance ¶ added in v1.17.0
type MintBalance struct {
// The mint the balance is for
Mint *v1.SolanaAccountId `protobuf:"bytes,1,opt,name=mint,proto3" json:"mint,omitempty"`
// The balance value, in quarks, denominated in the core mint
CoreMintValue uint64 `protobuf:"varint,2,opt,name=core_mint_value,json=coreMintValue,proto3" json:"core_mint_value,omitempty"`
// The balance value denominated in fiat, keyed by currency code. Only
// populated for the currency codes requested in
// GetBalancesRequest.currency_codes.
FiatValuesByCurrency map[string]float64 `` /* 215-byte string literal not displayed */
// The balance amount, in quarks, of the mint the balance is for
Quarks uint64 `protobuf:"varint,4,opt,name=quarks,proto3" json:"quarks,omitempty"`
// contains filtered or unexported fields
}
func (*MintBalance) Descriptor
deprecated
added in
v1.17.0
func (*MintBalance) Descriptor() ([]byte, []int)
Deprecated: Use MintBalance.ProtoReflect.Descriptor instead.
func (*MintBalance) GetCoreMintValue ¶ added in v1.17.0
func (x *MintBalance) GetCoreMintValue() uint64
func (*MintBalance) GetFiatValuesByCurrency ¶ added in v1.17.0
func (x *MintBalance) GetFiatValuesByCurrency() map[string]float64
func (*MintBalance) GetMint ¶ added in v1.17.0
func (x *MintBalance) GetMint() *v1.SolanaAccountId
func (*MintBalance) GetQuarks ¶ added in v1.18.0
func (x *MintBalance) GetQuarks() uint64
func (*MintBalance) ProtoMessage ¶ added in v1.17.0
func (*MintBalance) ProtoMessage()
func (*MintBalance) ProtoReflect ¶ added in v1.17.0
func (x *MintBalance) ProtoReflect() protoreflect.Message
func (*MintBalance) Reset ¶ added in v1.17.0
func (x *MintBalance) Reset()
func (*MintBalance) String ¶ added in v1.17.0
func (x *MintBalance) String() string
func (*MintBalance) Validate ¶ added in v1.17.0
func (m *MintBalance) Validate() error
Validate checks the field values on MintBalance with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type MintBalanceValidationError ¶ added in v1.17.0
type MintBalanceValidationError struct {
// contains filtered or unexported fields
}
MintBalanceValidationError is the validation error returned by MintBalance.Validate if the designated constraints aren't met.
func (MintBalanceValidationError) Cause ¶ added in v1.17.0
func (e MintBalanceValidationError) Cause() error
Cause function returns cause value.
func (MintBalanceValidationError) Error ¶ added in v1.17.0
func (e MintBalanceValidationError) Error() string
Error satisfies the builtin error interface
func (MintBalanceValidationError) ErrorName ¶ added in v1.17.0
func (e MintBalanceValidationError) ErrorName() string
ErrorName returns error name.
func (MintBalanceValidationError) Field ¶ added in v1.17.0
func (e MintBalanceValidationError) Field() string
Field function returns field value.
func (MintBalanceValidationError) Key ¶ added in v1.17.0
func (e MintBalanceValidationError) Key() bool
Key function returns key value.
func (MintBalanceValidationError) Reason ¶ added in v1.17.0
func (e MintBalanceValidationError) Reason() string
Reason function returns reason value.
type OwnerBalance ¶ added in v1.17.0
type OwnerBalance struct {
// The owner account the balance is for
Owner *v1.SolanaAccountId `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
// The total core mint value, in quarks, across all balances for the owner
CoreMintValue uint64 `protobuf:"varint,2,opt,name=core_mint_value,json=coreMintValue,proto3" json:"core_mint_value,omitempty"`
// Individual balances keyed by mint address. Not populated when
// GetBalancesRequest.exclude_per_mint_balances is true.
BalancesByMint map[string]*MintBalance `` /* 193-byte string literal not displayed */
// The total fiat value across all balances for the owner, keyed by currency
// code. Only populated for the currency codes requested in
// GetBalancesRequest.currency_codes.
FiatValuesByCurrency map[string]float64 `` /* 215-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*OwnerBalance) Descriptor
deprecated
added in
v1.17.0
func (*OwnerBalance) Descriptor() ([]byte, []int)
Deprecated: Use OwnerBalance.ProtoReflect.Descriptor instead.
func (*OwnerBalance) GetBalancesByMint ¶ added in v1.17.0
func (x *OwnerBalance) GetBalancesByMint() map[string]*MintBalance
func (*OwnerBalance) GetCoreMintValue ¶ added in v1.17.0
func (x *OwnerBalance) GetCoreMintValue() uint64
func (*OwnerBalance) GetFiatValuesByCurrency ¶ added in v1.17.0
func (x *OwnerBalance) GetFiatValuesByCurrency() map[string]float64
func (*OwnerBalance) GetOwner ¶ added in v1.17.0
func (x *OwnerBalance) GetOwner() *v1.SolanaAccountId
func (*OwnerBalance) ProtoMessage ¶ added in v1.17.0
func (*OwnerBalance) ProtoMessage()
func (*OwnerBalance) ProtoReflect ¶ added in v1.17.0
func (x *OwnerBalance) ProtoReflect() protoreflect.Message
func (*OwnerBalance) Reset ¶ added in v1.17.0
func (x *OwnerBalance) Reset()
func (*OwnerBalance) String ¶ added in v1.17.0
func (x *OwnerBalance) String() string
func (*OwnerBalance) Validate ¶ added in v1.17.0
func (m *OwnerBalance) Validate() error
Validate checks the field values on OwnerBalance with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type OwnerBalanceValidationError ¶ added in v1.17.0
type OwnerBalanceValidationError struct {
// contains filtered or unexported fields
}
OwnerBalanceValidationError is the validation error returned by OwnerBalance.Validate if the designated constraints aren't met.
func (OwnerBalanceValidationError) Cause ¶ added in v1.17.0
func (e OwnerBalanceValidationError) Cause() error
Cause function returns cause value.
func (OwnerBalanceValidationError) Error ¶ added in v1.17.0
func (e OwnerBalanceValidationError) Error() string
Error satisfies the builtin error interface
func (OwnerBalanceValidationError) ErrorName ¶ added in v1.17.0
func (e OwnerBalanceValidationError) ErrorName() string
ErrorName returns error name.
func (OwnerBalanceValidationError) Field ¶ added in v1.17.0
func (e OwnerBalanceValidationError) Field() string
Field function returns field value.
func (OwnerBalanceValidationError) Key ¶ added in v1.17.0
func (e OwnerBalanceValidationError) Key() bool
Key function returns key value.
func (OwnerBalanceValidationError) Reason ¶ added in v1.17.0
func (e OwnerBalanceValidationError) Reason() string
Reason function returns reason value.
type UnimplementedBalanceServer ¶
type UnimplementedBalanceServer struct {
}
UnimplementedBalanceServer must be embedded to have forward compatible implementations.
func (UnimplementedBalanceServer) GetBalances ¶ added in v1.17.0
func (UnimplementedBalanceServer) GetBalances(context.Context, *GetBalancesRequest) (*GetBalancesResponse, error)
type UnsafeBalanceServer ¶
type UnsafeBalanceServer interface {
// contains filtered or unexported methods
}
UnsafeBalanceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BalanceServer will result in compilation errors.