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

126 lines
4.1 KiB
Protocol Buffer
Raw Normal View History

2019-11-18 13:34:06 +00:00
syntax = "proto3";
package accounting;
2020-03-31 07:05:26 +00:00
option go_package = "github.com/nspcc-dev/neofs-api-go/accounting";
2020-02-05 13:58:06 +00:00
option csharp_namespace = "NeoFS.API.Accounting";
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;
message Account {
// OwnerID is a wallet address
2019-11-18 13:34:06 +00:00
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// Address is identifier of accounting record
2019-11-18 13:34:06 +00:00
string Address = 2;
// ParentAddress is identifier of parent accounting record
2019-11-18 13:34:06 +00:00
string ParentAddress = 3;
// ActiveFunds is amount of active (non locked) funds for account
2019-11-18 13:34:06 +00:00
decimal.Decimal ActiveFunds = 4;
// Lifetime is time until account is valid (used for lock accounts)
2019-11-18 13:34:06 +00:00
Lifetime Lifetime = 5 [(gogoproto.nullable) = false];
// LockTarget is the purpose of lock funds (it might be withdraw or payment for storage)
2019-11-18 13:34:06 +00:00
LockTarget LockTarget = 6;
// LockAccounts contains child accounts with locked funds
2019-11-18 13:34:06 +00:00
repeated Account LockAccounts = 7;
}
// LockTarget must be one of two options
2019-11-18 13:34:06 +00:00
message LockTarget {
oneof Target {
// WithdrawTarget used when user requested withdraw
2019-11-18 13:34:06 +00:00
WithdrawTarget WithdrawTarget = 1;
// ContainerCreateTarget used when user requested creation of container
2019-11-18 13:34:06 +00:00
ContainerCreateTarget ContainerCreateTarget = 2;
}
}
message Balances {
// Accounts contains multiple account snapshots
2019-11-18 13:34:06 +00:00
repeated Account Accounts = 1 [(gogoproto.nullable) = false];
}
message PayIO {
// BlockID contains id of the NEO block where withdraw or deposit
// call was invoked
2019-11-18 13:34:06 +00:00
uint64 BlockID = 1;
// Transactions contains all transactions that founded in block
// and used for PayIO
2019-11-18 13:34:06 +00:00
repeated Tx Transactions = 2 [(gogoproto.nullable) = false];
}
message Lifetime {
// Unit can be Unlimited, based on NeoFS epoch or Neo block
2019-11-18 13:34:06 +00:00
enum Unit {
Unlimited = 0;
NeoFSEpoch = 1;
NeoBlock = 2;
}
// Unit describes how lifetime is measured in account
2019-11-18 13:34:06 +00:00
Unit unit = 1 [(gogoproto.customname) = "Unit"];
// Value describes how long lifetime will be valid
2019-11-18 13:34:06 +00:00
int64 Value = 2;
}
message Tx {
// Type can be withdrawal, payIO or inner
2019-11-18 13:34:06 +00:00
enum Type {
Unknown = 0;
Withdraw = 1;
PayIO = 2;
Inner = 3;
}
// Type describes target of transaction
2019-11-18 13:34:06 +00:00
Type type = 1 [(gogoproto.customname) = "Type"];
// From describes sender of funds
2019-11-18 13:34:06 +00:00
string From = 2;
// To describes receiver of funds
2019-11-18 13:34:06 +00:00
string To = 3;
// Amount describes amount of funds
2019-11-18 13:34:06 +00:00
decimal.Decimal Amount = 4;
// PublicKeys contains public key of sender
bytes PublicKeys = 5;
2019-11-18 13:34:06 +00:00
}
message Settlement {
message Receiver {
// To is the address of funds recipient
2019-11-18 13:34:06 +00:00
string To = 1;
// Amount is the amount of funds that will be sent
2019-11-18 13:34:06 +00:00
decimal.Decimal Amount = 2;
}
message Container {
// CID is container identifier
2019-11-18 13:34:06 +00:00
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
// SGIDs is a set of storage groups that successfully passed the audit
2019-11-18 13:34:06 +00:00
repeated bytes SGIDs = 2 [(gogoproto.customtype) = "SGID", (gogoproto.nullable) = false];
}
message Tx {
// From is the address of the sender of funds
2019-11-18 13:34:06 +00:00
string From = 1;
// Container that successfully had passed the audit
2019-11-18 13:34:06 +00:00
Container Container = 2 [(gogoproto.nullable) = false];
// Receivers is a set of addresses of funds recipients
2019-11-18 13:34:06 +00:00
repeated Receiver Receivers = 3 [(gogoproto.nullable) = false];
}
// Epoch contains an epoch when settlement was accepted
2019-11-18 13:34:06 +00:00
uint64 Epoch = 1;
// Transactions is a set of transactions
2019-11-18 13:34:06 +00:00
repeated Tx Transactions = 2;
}
message ContainerCreateTarget {
// CID is container identifier
2019-11-18 13:34:06 +00:00
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
}
message WithdrawTarget {
// Cheque is a string representation of cheque id
2019-11-18 13:34:06 +00:00
string Cheque = 1;
}