Compare commits

...

3 Commits

6 changed files with 69 additions and 0 deletions
+37
View File
@@ -4,6 +4,43 @@ package ledger.v1;
import "google/protobuf/timestamp.proto";
message OperatingModeResponse {
// NORMAL or GL_ONLY. No automatic outage failover.
string mode = 1;
int64 revision = 2;
string actor_id = 3;
string reason = 4;
google.protobuf.Timestamp changed_at = 5;
}
message SetOperatingModeRequest {
string mode = 1;
int64 expected_revision = 2;
string actor_id = 3;
string reason = 4;
// Required when returning from GL_ONLY to NORMAL.
bool reconciliation_confirmed = 5;
}
message GetUserBalancesRequest {
string owner_type = 1;
string owner_id = 2;
optional int64 asset_id = 3;
}
message UserAssetBalance {
int64 asset_id = 1;
string available = 2;
string frozen = 3;
string total = 4;
}
message GetUserBalancesResponse {
string owner_type = 1;
string owner_id = 2;
repeated UserAssetBalance balances = 3;
}
enum AccountClass {
ACCOUNT_CLASS_UNSPECIFIED = 0;
ACCOUNT_CLASS_USER_AVAILABLE = 1;
+6
View File
@@ -6,6 +6,12 @@ import "base/v1/msg.proto";
import "ledger/v1/msg.proto";
service GeneralLedgerService {
rpc GetOperatingMode(base.v1.Empty) returns (OperatingModeResponse);
// Operator-only; requires x-admin-token and an optimistic revision.
rpc SetOperatingMode(SetOperatingModeRequest) returns (OperatingModeResponse);
// Trusted internal execution; requires x-admin-token and GL_ONLY mode.
rpc PostInternalJournal(AppendJournalRequest) returns (AppendJournalResponse);
rpc GetUserBalances(GetUserBalancesRequest) returns (GetUserBalancesResponse);
rpc Health(base.v1.Empty) returns (HealthResponse);
rpc AppendJournal(AppendJournalRequest) returns (AppendJournalResponse);
rpc AppendTransactionEvent(AppendTransactionEventRequest) returns (AppendTransactionEventResponse);
+13
View File
@@ -72,6 +72,8 @@ message MarketOrder {
repeated string comment = 21;
optional MarketOrder source = 22; // purchase is done via this field
bool is_ico = 23;
optional string starts_at = 24; // RFC3339; absent means immediately available
optional string ends_at = 25; // RFC3339; absent means no scheduled end
// repeated string attachments = 14; // possible files included by
// seller/buyer
}
@@ -113,6 +115,15 @@ message MarketOrderList {
uint32 total_count = 4;
}
// AdminCancelOrderReq is used by trusted administrative tooling to cancel an
// order through the wallet service. The wallet service authenticates the
// caller with the administrative gRPC token; actor_user_id is retained for
// audit attribution.
message AdminCancelOrderReq {
uint64 order_id = 1;
int64 actor_user_id = 2;
}
/*
* participant_type: IS Maker/Taker
* side: IS Buying/Selling
@@ -132,6 +143,8 @@ message NewMarketReq {
// TODO: maker market order as optional
optional uint64 maker_order_id = 9;
bool is_ico = 10;
optional string starts_at = 11; // RFC3339
optional string ends_at = 12; // RFC3339
}
enum MarketOrdersSortBy {
+2
View File
@@ -20,6 +20,8 @@ service MarketplaceSrv {
rpc CalcICOBuy(wallet.v1.BuyAssetReq) returns (wallet.v1.CalcBuyAssetRes);
rpc CancelOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // cancel an order
rpc AdminCancelOrder(AdminCancelOrderReq) returns (base.v1.StatusRes); // cancel an order from trusted admin tooling
rpc DeleteOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // delete a closed order
rpc NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market
rpc GenerateMarketContract(MarketContractReq) returns (ContractMarketRes);
+2
View File
@@ -29,4 +29,6 @@ service InternalWalletSrv {
// deactivation/locking so referenced financial history remains intact.
rpc AdminUpsertAsset(AdminUpsertAssetReq) returns (AdminAssetMutationRes);
rpc AdminDeactivateAsset(AdminDeactivateAssetReq) returns (base.v1.StatusRes);
rpc AdminApproveIRTWithdrawal(AdminApproveIRTWithdrawalReq) returns (base.v1.StatusRes);
}
+9
View File
@@ -227,6 +227,15 @@ message LockAssetReq {
optional auth.v1.TFA tfa = 4; // if request is not internal
}
// Administrative approval is the only transition that may enqueue an IRT
// withdrawal for blockchain settlement. The receipt identifies the completed
// off-chain bank payment.
message AdminApproveIRTWithdrawalReq {
uint64 withdraw_log_id = 1;
string bank_receipt = 2;
int64 actor_user_id = 3;
}
/*
BNPL - not really but close name
*/