2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 18:01:50 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.accounting;
|
2020-08-05 18:01:50 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Accounting";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-08-18 11:32:48 +00:00
|
|
|
import "accounting/types.proto";
|
2020-08-05 16:49:16 +00:00
|
|
|
import "refs/types.proto";
|
2020-08-19 14:00:23 +00:00
|
|
|
import "session/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-10-13 09:57:07 +00:00
|
|
|
// Accounting service provides methods for interaction with NeoFS sidechain via
|
|
|
|
// other NeoFS nodes to get information about the account balance. Deposit and
|
|
|
|
// Withdraw operations can't be implemented here, as they require Mainnet NeoFS
|
|
|
|
// smart contract invocation. Transfer operations between internal NeoFS
|
2022-04-13 06:21:33 +00:00
|
|
|
// accounts are possible if both use the same token type.
|
2020-08-12 21:43:51 +00:00
|
|
|
service AccountingService {
|
2020-10-13 09:57:07 +00:00
|
|
|
// Returns the amount of funds in GAS token for the requested NeoFS account.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
|
|
|
// - **OK** (0, SECTION_SUCCESS):
|
|
|
|
// balance has been successfully read;
|
|
|
|
// - Common failures (SECTION_FAILURE_COMMON).
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc Balance (BalanceRequest) returns (BalanceResponse);
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-10-13 09:57:07 +00:00
|
|
|
// BalanceRequest message
|
2020-01-30 11:41:24 +00:00
|
|
|
message BalanceRequest {
|
2022-04-13 06:21:33 +00:00
|
|
|
// To indicate the account for which the balance is requested, its identifier
|
2020-10-13 09:57:07 +00:00
|
|
|
// is used. It can be any existing account in NeoFS sidechain `Balance` smart
|
|
|
|
// contract. If omitted, client implementation MUST set it to the request's
|
|
|
|
// signer `OwnerID`.
|
2020-08-11 08:12:37 +00:00
|
|
|
message Body {
|
2020-10-13 09:57:07 +00:00
|
|
|
// Valid user identifier in `OwnerID` format for which the balance is
|
|
|
|
// requested. Required field.
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 1;
|
2020-08-11 08:12:37 +00: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 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 08:12:37 +00:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-13 09:57:07 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-10-13 09:57:07 +00:00
|
|
|
// BalanceResponse message
|
2020-01-30 11:41:24 +00:00
|
|
|
message BalanceResponse {
|
2020-10-13 09:57:07 +00:00
|
|
|
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
2022-04-13 06:21:33 +00:00
|
|
|
// Balance is given in the `Decimal` format to avoid precision issues with rounding.
|
2020-08-11 08:12:37 +00:00
|
|
|
message Body {
|
2020-10-13 09:57:07 +00:00
|
|
|
// Amount of funds in GAS token for the requested account.
|
2020-08-11 08:12:37 +00: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 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 08:12:37 +00:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-13 09:57:07 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|