frostfs-api-go/accounting/withdraw.proto

101 lines
5 KiB
Protocol Buffer
Raw Normal View History

2019-11-18 13:34:06 +00:00
syntax = "proto3";
package accounting;
option go_package = "github.com/nspcc-dev/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;
// Withdraw is a service that provides withdraw assets operations from the NeoFS
2019-11-18 13:34:06 +00:00
service Withdraw {
// Get returns cheque if it was signed by inner ring nodes
2019-11-18 13:34:06 +00:00
rpc Get(GetRequest) returns (GetResponse);
// 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);
// List shows all user's checks
2019-11-18 13:34:06 +00:00
rpc List(ListRequest) returns (ListResponse);
// Delete allows user to remove unused cheque
2019-11-18 13:34:06 +00:00
rpc Delete(DeleteRequest) returns (DeleteResponse);
}
message Item {
// ID is a cheque identifier
2019-11-18 13:34:06 +00:00
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
// OwnerID is a wallet address
2019-11-18 13:34:06 +00:00
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// Amount of funds
2019-11-18 13:34:06 +00:00
decimal.Decimal Amount = 3;
// Height is the neo blockchain height until the cheque is valid
2019-11-18 13:34:06 +00:00
uint64 Height = 4;
// Payload contains cheque representation in bytes
2019-11-18 13:34:06 +00:00
bytes Payload = 5;
}
message GetRequest {
// ID is cheque identifier
2019-11-18 16:22:08 +00:00
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
// 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-18 13:34:06 +00:00
message GetResponse {
// Withdraw is cheque with meta information
2019-11-18 13:34:06 +00:00
Item Withdraw = 1;
}
message PutRequest {
// OwnerID is a wallet address
2019-11-18 16:22:08 +00:00
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// Amount of funds
2019-11-18 16:22:08 +00:00
decimal.Decimal Amount = 2;
// Height is the neo blockchain height until the cheque is valid
2019-11-18 16:22:08 +00:00
uint64 Height = 3;
// 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 {
// ID is cheque identifier
2019-11-18 13:34:06 +00:00
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
}
message ListRequest {
// 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-18 13:34:06 +00:00
message ListResponse {
// Items is a set of cheques with meta information
2019-11-18 13:34:06 +00:00
repeated Item Items = 1;
}
message DeleteRequest {
// ID is cheque identifier
2019-11-18 16:22:08 +00:00
bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false];
// OwnerID is a wallet address
2019-11-18 16:22:08 +00:00
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// 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
}
// DeleteResponse is empty
2019-11-18 13:34:06 +00:00
message DeleteResponse {}