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;
|
|
|
|
|
|
|
|
message Account {
|
2019-11-20 15:57:51 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// Address is identifier of accounting record
|
2019-11-18 13:34:06 +00:00
|
|
|
string Address = 2;
|
2019-11-20 15:57:51 +00:00
|
|
|
// ParentAddress is identifier of parent accounting record
|
2019-11-18 13:34:06 +00:00
|
|
|
string ParentAddress = 3;
|
2019-11-20 15:57:51 +00:00
|
|
|
// ActiveFunds is amount of active (non locked) funds for account
|
2019-11-18 13:34:06 +00:00
|
|
|
decimal.Decimal ActiveFunds = 4;
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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];
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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;
|
2019-11-20 15:57:51 +00:00
|
|
|
// LockAccounts contains child accounts with locked funds
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated Account LockAccounts = 7;
|
|
|
|
}
|
|
|
|
|
2019-11-20 15:57:51 +00:00
|
|
|
// LockTarget must be one of two options
|
2019-11-18 13:34:06 +00:00
|
|
|
message LockTarget {
|
|
|
|
oneof Target {
|
2019-11-20 15:57:51 +00:00
|
|
|
// WithdrawTarget used when user requested withdraw
|
2019-11-18 13:34:06 +00:00
|
|
|
WithdrawTarget WithdrawTarget = 1;
|
2019-11-20 15:57:51 +00:00
|
|
|
// ContainerCreateTarget used when user requested creation of container
|
2019-11-18 13:34:06 +00:00
|
|
|
ContainerCreateTarget ContainerCreateTarget = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message Balances {
|
2019-11-20 15:57:51 +00:00
|
|
|
// Accounts contains multiple account snapshots
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated Account Accounts = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
message PayIO {
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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;
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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 {
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2019-11-20 15:57:51 +00:00
|
|
|
// Unit describes how lifetime is measured in account
|
2019-11-18 13:34:06 +00:00
|
|
|
Unit unit = 1 [(gogoproto.customname) = "Unit"];
|
2019-11-20 15:57:51 +00:00
|
|
|
// Value describes how long lifetime will be valid
|
2019-11-18 13:34:06 +00:00
|
|
|
int64 Value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Tx {
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2019-11-20 15:57:51 +00:00
|
|
|
// Type describes target of transaction
|
2019-11-18 13:34:06 +00:00
|
|
|
Type type = 1 [(gogoproto.customname) = "Type"];
|
2019-11-20 15:57:51 +00:00
|
|
|
// From describes sender of funds
|
2019-11-18 13:34:06 +00:00
|
|
|
string From = 2;
|
2019-11-20 15:57:51 +00:00
|
|
|
// To describes receiver of funds
|
2019-11-18 13:34:06 +00:00
|
|
|
string To = 3;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Amount describes amount of funds
|
2019-11-18 13:34:06 +00:00
|
|
|
decimal.Decimal Amount = 4;
|
2019-11-20 15:57:51 +00:00
|
|
|
// PublicKeys contains public key of sender
|
|
|
|
bytes PublicKeys = 5;
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Settlement {
|
|
|
|
message Receiver {
|
2019-11-20 15:57:51 +00:00
|
|
|
// To is the address of funds recipient
|
2019-11-18 13:34:06 +00:00
|
|
|
string To = 1;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Amount is the amount of funds that will be sent
|
2019-11-18 13:34:06 +00:00
|
|
|
decimal.Decimal Amount = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Container {
|
2019-11-20 15:57:51 +00:00
|
|
|
// CID is container identifier
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// 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 {
|
2019-11-20 15:57:51 +00:00
|
|
|
// From is the address of the sender of funds
|
2019-11-18 13:34:06 +00:00
|
|
|
string From = 1;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Container that successfully had passed the audit
|
2019-11-18 13:34:06 +00:00
|
|
|
Container Container = 2 [(gogoproto.nullable) = false];
|
2019-11-20 15:57:51 +00:00
|
|
|
// Receivers is a set of addresses of funds recipients
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated Receiver Receivers = 3 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
2019-11-20 15:57:51 +00:00
|
|
|
// Epoch contains an epoch when settlement was accepted
|
2019-11-18 13:34:06 +00:00
|
|
|
uint64 Epoch = 1;
|
2019-11-20 15:57:51 +00:00
|
|
|
// Transactions is a set of transactions
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated Tx Transactions = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ContainerCreateTarget {
|
2019-11-20 15:57:51 +00:00
|
|
|
// CID is container identifier
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
message WithdrawTarget {
|
2019-11-20 15:57:51 +00:00
|
|
|
// Cheque is a string representation of cheque id
|
2019-11-18 13:34:06 +00:00
|
|
|
string Cheque = 1;
|
|
|
|
}
|