2019-11-18 13:34:06 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package accounting;
|
2020-01-30 13:32:50 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api/accounting";
|
2020-02-05 13:58:06 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.Accounting";
|
2019-11-18 13:34:06 +00:00
|
|
|
|
2019-11-18 16:22:08 +00:00
|
|
|
import "service/meta.proto";
|
|
|
|
import "service/verify.proto";
|
2019-11-18 13:34:06 +00:00
|
|
|
import "decimal/decimal.proto";
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
|
|
|
|
option (gogoproto.stable_marshaler_all) = true;
|
|
|
|
|
2019-11-20 15:57:51 +00:00
|
|
|
// Withdraw is a service that provides withdraw assets operations from the NeoFS
|
2019-11-18 13:34:06 +00:00
|
|
|
service Withdraw {
|
2019-11-20 15:57:51 +00:00
|
|
|
// Get returns cheque if it was signed by inner ring nodes
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Get(GetRequest) returns (GetResponse);
|
2019-11-20 15:57:51 +00:00
|
|
|
// Put ask inner ring nodes to sign a cheque for withdraw invoke
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Put(PutRequest) returns (PutResponse);
|
2019-11-20 15:57:51 +00:00
|
|
|
// List shows all user's checks
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc List(ListRequest) returns (ListResponse);
|
2019-11-20 15:57:51 +00:00
|
|
|
// Delete allows user to remove unused cheque
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
message Item {
|
2019-11-20 15:57:51 +00:00
|
|
|
// ID is a cheque identifier
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// Amount of funds
|
2019-11-18 13:34:06 +00:00
|
|
|
decimal.Decimal Amount = 3;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Height is the neo blockchain height until the cheque is valid
|
2019-11-18 13:34:06 +00:00
|
|
|
uint64 Height = 4;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Payload contains cheque representation in bytes
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes Payload = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetRequest {
|
2019-11-20 15:57:51 +00:00
|
|
|
// ID is cheque identifier
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
|
|
|
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
|
|
|
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
2019-11-20 15:57:51 +00:00
|
|
|
|
2019-11-18 13:34:06 +00:00
|
|
|
message GetResponse {
|
2019-11-21 07:26:01 +00:00
|
|
|
// Withdraw is cheque with meta information
|
2019-11-18 13:34:06 +00:00
|
|
|
Item Withdraw = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PutRequest {
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// Amount of funds
|
2019-11-18 16:22:08 +00:00
|
|
|
decimal.Decimal Amount = 2;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Height is the neo blockchain height until the cheque is valid
|
2019-11-18 16:22:08 +00:00
|
|
|
uint64 Height = 3;
|
2019-11-20 15:57:51 +00:00
|
|
|
// MessageID is a nonce for uniq request (UUIDv4)
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes MessageID = 4 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false];
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
|
|
|
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
|
|
|
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
|
|
|
message PutResponse {
|
2019-11-20 15:57:51 +00:00
|
|
|
// ID is cheque identifier
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRequest {
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
|
|
|
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
|
|
|
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
2019-11-20 15:57:51 +00:00
|
|
|
|
2019-11-18 13:34:06 +00:00
|
|
|
message ListResponse {
|
2019-11-21 07:26:01 +00:00
|
|
|
// Items is a set of cheques with meta information
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated Item Items = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteRequest {
|
2019-11-20 15:57:51 +00:00
|
|
|
// ID is cheque identifier
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// MessageID is a nonce for uniq request (UUIDv4)
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes MessageID = 3 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false];
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
|
|
|
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
|
|
|
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
2019-11-20 15:57:51 +00:00
|
|
|
|
|
|
|
// DeleteResponse is empty
|
2019-11-18 13:34:06 +00:00
|
|
|
message DeleteResponse {}
|