accounting

package
v0.0.0-...-2b8329e Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AccountingService_Balance_FullMethodName = "/neo.fs.v2.accounting.AccountingService/Balance"
)

Variables

View Source
var AccountingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "neo.fs.v2.accounting.AccountingService",
	HandlerType: (*AccountingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Balance",
			Handler:    _AccountingService_Balance_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/accounting/grpc/service.proto",
}

AccountingService_ServiceDesc is the grpc.ServiceDesc for AccountingService 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_api_accounting_grpc_service_proto protoreflect.FileDescriptor
View Source
var File_api_accounting_grpc_types_proto protoreflect.FileDescriptor

Functions

func RegisterAccountingServiceServer

func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer)

Types

type AccountingServiceClient

type AccountingServiceClient interface {
	// Returns the amount of funds in GAS token for the requested FrostFS account.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// balance has been successfully read;
	// - Common failures (SECTION_FAILURE_COMMON).
	Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error)
}

AccountingServiceClient is the client API for AccountingService 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.

Accounting service provides methods for interaction with FrostFS sidechain via other FrostFS nodes to get information about the account balance. Deposit and Withdraw operations can't be implemented here, as they require Mainnet FrostFS smart contract invocation. Transfer operations between internal FrostFS accounts are possible if both use the same token type.

type AccountingServiceServer

type AccountingServiceServer interface {
	// Returns the amount of funds in GAS token for the requested FrostFS account.
	//
	// Statuses:
	// - **OK** (0, SECTION_SUCCESS):
	// balance has been successfully read;
	// - Common failures (SECTION_FAILURE_COMMON).
	Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
}

AccountingServiceServer is the server API for AccountingService service. All implementations should embed UnimplementedAccountingServiceServer for forward compatibility.

Accounting service provides methods for interaction with FrostFS sidechain via other FrostFS nodes to get information about the account balance. Deposit and Withdraw operations can't be implemented here, as they require Mainnet FrostFS smart contract invocation. Transfer operations between internal FrostFS accounts are possible if both use the same token type.

type BalanceRequest

type BalanceRequest struct {

	// Body of the balance request message.
	Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
	// Carries request meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
	// Carries request verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

BalanceRequest message

func (*BalanceRequest) ClearBody

func (x *BalanceRequest) ClearBody()

func (*BalanceRequest) ClearMetaHeader

func (x *BalanceRequest) ClearMetaHeader()

func (*BalanceRequest) ClearVerifyHeader

func (x *BalanceRequest) ClearVerifyHeader()

func (*BalanceRequest) GetBody

func (x *BalanceRequest) GetBody() *BalanceRequest_Body

func (*BalanceRequest) GetMetaHeader

func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader

func (*BalanceRequest) GetVerifyHeader

func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader

func (*BalanceRequest) HasBody

func (x *BalanceRequest) HasBody() bool

func (*BalanceRequest) HasMetaHeader

func (x *BalanceRequest) HasMetaHeader() bool

func (*BalanceRequest) HasVerifyHeader

func (x *BalanceRequest) HasVerifyHeader() bool

func (*BalanceRequest) ProtoMessage

func (*BalanceRequest) ProtoMessage()

func (*BalanceRequest) ProtoReflect

func (x *BalanceRequest) ProtoReflect() protoreflect.Message

func (*BalanceRequest) Reset

func (x *BalanceRequest) Reset()

func (*BalanceRequest) SetBody

func (x *BalanceRequest) SetBody(v *BalanceRequest_Body)

func (*BalanceRequest) SetMetaHeader

func (x *BalanceRequest) SetMetaHeader(v *grpc.RequestMetaHeader)

func (*BalanceRequest) SetVerifyHeader

func (x *BalanceRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader)

func (*BalanceRequest) String

func (x *BalanceRequest) String() string

type BalanceRequest_Body

type BalanceRequest_Body struct {

	// Valid user identifier in `OwnerID` format for which the balance is
	// requested. Required field.
	OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"`
	// contains filtered or unexported fields
}

To indicate the account for which the balance is requested, its identifier is used. It can be any existing account in FrostFS sidechain `Balance` smart contract. If omitted, client implementation MUST set it to the request's signer `OwnerID`.

func (*BalanceRequest_Body) ClearOwnerId

func (x *BalanceRequest_Body) ClearOwnerId()

func (*BalanceRequest_Body) GetOwnerId

func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID

func (*BalanceRequest_Body) HasOwnerId

func (x *BalanceRequest_Body) HasOwnerId() bool

func (*BalanceRequest_Body) ProtoMessage

func (*BalanceRequest_Body) ProtoMessage()

func (*BalanceRequest_Body) ProtoReflect

func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message

func (*BalanceRequest_Body) Reset

func (x *BalanceRequest_Body) Reset()

func (*BalanceRequest_Body) SetOwnerId

func (x *BalanceRequest_Body) SetOwnerId(v *grpc1.OwnerID)

func (*BalanceRequest_Body) String

func (x *BalanceRequest_Body) String() string

type BalanceRequest_Body_builder

type BalanceRequest_Body_builder struct {

	// Valid user identifier in `OwnerID` format for which the balance is
	// requested. Required field.
	OwnerId *grpc1.OwnerID
	// contains filtered or unexported fields
}

func (BalanceRequest_Body_builder) Build

type BalanceRequest_builder

type BalanceRequest_builder struct {

	// Body of the balance request message.
	Body *BalanceRequest_Body
	// Carries request meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.RequestMetaHeader
	// Carries request verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.RequestVerificationHeader
	// contains filtered or unexported fields
}

func (BalanceRequest_builder) Build

type BalanceResponse

type BalanceResponse struct {

	// Body of the balance response message.
	Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
	// Carries response meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
	// Carries response verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
	// contains filtered or unexported fields
}

BalanceResponse message

func (*BalanceResponse) ClearBody

func (x *BalanceResponse) ClearBody()

func (*BalanceResponse) ClearMetaHeader

func (x *BalanceResponse) ClearMetaHeader()

func (*BalanceResponse) ClearVerifyHeader

func (x *BalanceResponse) ClearVerifyHeader()

func (*BalanceResponse) GetBody

func (x *BalanceResponse) GetBody() *BalanceResponse_Body

func (*BalanceResponse) GetMetaHeader

func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader

func (*BalanceResponse) GetVerifyHeader

func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader

func (*BalanceResponse) HasBody

func (x *BalanceResponse) HasBody() bool

func (*BalanceResponse) HasMetaHeader

func (x *BalanceResponse) HasMetaHeader() bool

func (*BalanceResponse) HasVerifyHeader

func (x *BalanceResponse) HasVerifyHeader() bool

func (*BalanceResponse) ProtoMessage

func (*BalanceResponse) ProtoMessage()

func (*BalanceResponse) ProtoReflect

func (x *BalanceResponse) ProtoReflect() protoreflect.Message

func (*BalanceResponse) Reset

func (x *BalanceResponse) Reset()

func (*BalanceResponse) SetBody

func (x *BalanceResponse) SetBody(v *BalanceResponse_Body)

func (*BalanceResponse) SetMetaHeader

func (x *BalanceResponse) SetMetaHeader(v *grpc.ResponseMetaHeader)

func (*BalanceResponse) SetVerifyHeader

func (x *BalanceResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader)

func (*BalanceResponse) String

func (x *BalanceResponse) String() string

type BalanceResponse_Body

type BalanceResponse_Body struct {

	// Amount of funds in GAS token for the requested account.
	Balance *Decimal `protobuf:"bytes,1,opt,name=balance" json:"balance,omitempty"`
	// contains filtered or unexported fields
}

The amount of funds in GAS token for the `OwnerID`'s account requested. Balance is given in the `Decimal` format to avoid precision issues with rounding.

func (*BalanceResponse_Body) ClearBalance

func (x *BalanceResponse_Body) ClearBalance()

func (*BalanceResponse_Body) GetBalance

func (x *BalanceResponse_Body) GetBalance() *Decimal

func (*BalanceResponse_Body) HasBalance

func (x *BalanceResponse_Body) HasBalance() bool

func (*BalanceResponse_Body) ProtoMessage

func (*BalanceResponse_Body) ProtoMessage()

func (*BalanceResponse_Body) ProtoReflect

func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message

func (*BalanceResponse_Body) Reset

func (x *BalanceResponse_Body) Reset()

func (*BalanceResponse_Body) SetBalance

func (x *BalanceResponse_Body) SetBalance(v *Decimal)

func (*BalanceResponse_Body) String

func (x *BalanceResponse_Body) String() string

type BalanceResponse_Body_builder

type BalanceResponse_Body_builder struct {

	// Amount of funds in GAS token for the requested account.
	Balance *Decimal
	// contains filtered or unexported fields
}

func (BalanceResponse_Body_builder) Build

type BalanceResponse_builder

type BalanceResponse_builder struct {

	// Body of the balance response message.
	Body *BalanceResponse_Body
	// Carries response meta information. Header data is used only to regulate
	// message transport and does not affect request execution.
	MetaHeader *grpc.ResponseMetaHeader
	// Carries response verification information. This header is used to
	// authenticate the nodes of the message route and check the correctness of
	// transmission.
	VerifyHeader *grpc.ResponseVerificationHeader
	// contains filtered or unexported fields
}

func (BalanceResponse_builder) Build

type Decimal

type Decimal struct {

	// Number in the smallest Token fractions.
	Value *int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
	// Precision value indicating how many smallest fractions can be in one
	// integer.
	Precision *uint32 `protobuf:"varint,2,opt,name=precision" json:"precision,omitempty"`
	// contains filtered or unexported fields
}

Standard floating point data type can't be used in FrostFS due to inexactness of the result when doing lots of small number operations. To solve the lost precision issue, special `Decimal` format is used for monetary computations.

Please see [The General Decimal Arithmetic Specification](http://speleotrove.com/decimal/) for detailed problem description.

func (*Decimal) ClearPrecision

func (x *Decimal) ClearPrecision()

func (*Decimal) ClearValue

func (x *Decimal) ClearValue()

func (*Decimal) GetPrecision

func (x *Decimal) GetPrecision() uint32

func (*Decimal) GetValue

func (x *Decimal) GetValue() int64

func (*Decimal) HasPrecision

func (x *Decimal) HasPrecision() bool

func (*Decimal) HasValue

func (x *Decimal) HasValue() bool

func (*Decimal) ProtoMessage

func (*Decimal) ProtoMessage()

func (*Decimal) ProtoReflect

func (x *Decimal) ProtoReflect() protoreflect.Message

func (*Decimal) Reset

func (x *Decimal) Reset()

func (*Decimal) SetPrecision

func (x *Decimal) SetPrecision(v uint32)

func (*Decimal) SetValue

func (x *Decimal) SetValue(v int64)

func (*Decimal) String

func (x *Decimal) String() string

type Decimal_builder

type Decimal_builder struct {

	// Number in the smallest Token fractions.
	Value *int64
	// Precision value indicating how many smallest fractions can be in one
	// integer.
	Precision *uint32
	// contains filtered or unexported fields
}

func (Decimal_builder) Build

func (b0 Decimal_builder) Build() *Decimal

type UnimplementedAccountingServiceServer

type UnimplementedAccountingServiceServer struct{}

UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAccountingServiceServer) Balance

type UnsafeAccountingServiceServer

type UnsafeAccountingServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountingServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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