balance

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 21 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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)

View Source
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

Cause function returns cause value.

func (GetBalancesRequestValidationError) Error added in v1.17.0

Error satisfies the builtin error interface

func (GetBalancesRequestValidationError) ErrorName added in v1.17.0

ErrorName returns error name.

func (GetBalancesRequestValidationError) Field added in v1.17.0

Field function returns field value.

func (GetBalancesRequestValidationError) Key added in v1.17.0

Key function returns key value.

func (GetBalancesRequestValidationError) Reason added in v1.17.0

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 (*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

Cause function returns cause value.

func (GetBalancesResponseValidationError) Error added in v1.17.0

Error satisfies the builtin error interface

func (GetBalancesResponseValidationError) ErrorName added in v1.17.0

ErrorName returns error name.

func (GetBalancesResponseValidationError) Field added in v1.17.0

Field function returns field value.

func (GetBalancesResponseValidationError) Key added in v1.17.0

Key function returns key value.

func (GetBalancesResponseValidationError) Reason added in v1.17.0

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) Enum added in v1.17.0

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 (GetBalancesResponse_Result) String added in v1.17.0

func (GetBalancesResponse_Result) Type added in v1.17.0

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

Cause function returns cause value.

func (MintBalanceValidationError) Error added in v1.17.0

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

Field function returns field value.

func (MintBalanceValidationError) Key added in v1.17.0

Key function returns key value.

func (MintBalanceValidationError) Reason added in v1.17.0

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

Cause function returns cause value.

func (OwnerBalanceValidationError) Error added in v1.17.0

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

Field function returns field value.

func (OwnerBalanceValidationError) Key added in v1.17.0

Key function returns key value.

func (OwnerBalanceValidationError) Reason added in v1.17.0

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

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.

Jump to

Keyboard shortcuts

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