2024-12-26 14:06:59 +03:00
|
|
|
edition = "2023";
|
2020-08-05 21:01:50 +03:00
|
|
|
|
2020-08-13 00:43:51 +03:00
|
|
|
package neo.fs.v2.accounting;
|
2020-08-05 21:01:50 +03:00
|
|
|
|
2023-03-07 11:50:02 +03:00
|
|
|
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting";
|
2021-03-10 18:54:06 +08:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Accounting";
|
2020-01-30 14:41:24 +03:00
|
|
|
|
2020-08-18 14:32:48 +03:00
|
|
|
import "accounting/types.proto";
|
2020-08-05 19:49:16 +03:00
|
|
|
import "refs/types.proto";
|
2020-08-19 17:00:23 +03:00
|
|
|
import "session/types.proto";
|
2020-01-30 14:41:24 +03:00
|
|
|
|
2024-09-05 16:24:35 +03:00
|
|
|
// 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.
|
2020-08-13 00:43:51 +03:00
|
|
|
service AccountingService {
|
2024-09-05 16:24:35 +03:00
|
|
|
// Returns the amount of funds in GAS token for the requested FrostFS account.
|
2021-11-12 19:10:39 +03:00
|
|
|
//
|
|
|
|
// Statuses:
|
|
|
|
// - **OK** (0, SECTION_SUCCESS):
|
|
|
|
// balance has been successfully read;
|
|
|
|
// - Common failures (SECTION_FAILURE_COMMON).
|
2024-02-28 18:53:04 +03:00
|
|
|
rpc Balance(BalanceRequest) returns (BalanceResponse);
|
2020-01-30 14:41:24 +03:00
|
|
|
}
|
|
|
|
|
2020-10-13 12:57:07 +03:00
|
|
|
// BalanceRequest message
|
2020-01-30 14:41:24 +03:00
|
|
|
message BalanceRequest {
|
2022-04-13 09:21:33 +03:00
|
|
|
// To indicate the account for which the balance is requested, its identifier
|
2024-09-05 16:24:35 +03:00
|
|
|
// 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`.
|
2020-08-11 11:12:37 +03:00
|
|
|
message Body {
|
2020-10-13 12:57:07 +03:00
|
|
|
// Valid user identifier in `OwnerID` format for which the balance is
|
|
|
|
// requested. Required field.
|
2020-08-13 00:43:51 +03:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 1;
|
2020-08-11 11:12:37 +03:00
|
|
|
}
|
|
|
|
// Body of the balance request message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 17:00:23 +03:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 11:12:37 +03:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-13 12:57:07 +03:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 17:00:23 +03:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 14:41:24 +03:00
|
|
|
}
|
|
|
|
|
2020-10-13 12:57:07 +03:00
|
|
|
// BalanceResponse message
|
2020-01-30 14:41:24 +03:00
|
|
|
message BalanceResponse {
|
2020-10-13 12:57:07 +03:00
|
|
|
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
2024-02-28 18:53:04 +03:00
|
|
|
// Balance is given in the `Decimal` format to avoid precision issues with
|
|
|
|
// rounding.
|
2020-08-11 11:12:37 +03:00
|
|
|
message Body {
|
2020-10-13 12:57:07 +03:00
|
|
|
// Amount of funds in GAS token for the requested account.
|
2020-08-11 11:12:37 +03:00
|
|
|
Decimal balance = 1;
|
|
|
|
}
|
|
|
|
// Body of the balance response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 17:00:23 +03:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 11:12:37 +03:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-13 12:57:07 +03:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 17:00:23 +03:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 14:41:24 +03:00
|
|
|
}
|