frostfs-api-go-pogpp/accounting/withdraw.proto

95 lines
3.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-proto/accounting";
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 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];
// TTL must be larger than zero, it decreased in every neofs-node
2019-11-18 13:34:06 +00:00
uint32 TTL = 3;
}
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 13:34:06 +00:00
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// Amount of funds
2019-11-18 13:34:06 +00:00
decimal.Decimal Amount = 2;
// Height is the neo blockchain height until the cheque is valid
2019-11-18 13:34:06 +00:00
uint64 Height = 3;
// MessageID is a nonce for uniq request (UUIDv4)
2019-11-18 13:34:06 +00:00
bytes MessageID = 4 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false];
// Signature is a signature of the sent request
2019-11-18 13:34:06 +00:00
bytes Signature = 5;
// TTL must be larger than zero, it decreased in every neofs-node
2019-11-18 13:34:06 +00:00
uint32 TTL = 6;
}
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 13:34:06 +00:00
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// TTL must be larger than zero, it decreased in every neofs-node
2019-11-18 13:34:06 +00:00
uint32 TTL = 2;
}
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 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];
// MessageID is a nonce for uniq request (UUIDv4)
2019-11-18 13:34:06 +00:00
bytes MessageID = 3 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false];
// Signature is a signature of the sent request
2019-11-18 13:34:06 +00:00
bytes Signature = 4;
// TTL must be larger than zero, it decreased in every neofs-node
2019-11-18 13:34:06 +00:00
uint32 TTL = 5;
}
// DeleteResponse is empty
2019-11-18 13:34:06 +00:00
message DeleteResponse {}