Skip to content

Commit 216cd39

Browse files
committed
New iteration
1 parent 5b8f528 commit 216cd39

File tree

4 files changed

+256
-211
lines changed

4 files changed

+256
-211
lines changed

api-spec/protobuf/ark/v1/admin.proto

Lines changed: 117 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@ import "google/api/annotations.proto";
66
import "ark/v1/types.proto";
77

88
service AdminService {
9-
rpc GetScheduledSweep(GetScheduledSweepRequest) returns (GetScheduledSweepResponse) {
9+
rpc GetCommitmentTxInfo(GetCommitmentTxInfoRequest) returns (GetCommitmentTxInfoResponse) {
1010
option (google.api.http) = {
11-
get: "/v1/admin/sweeps"
11+
get: "/v1/admin/commitmentTx/{id}"
1212
};
1313
}
14-
rpc GetBatch(GetBatchRequest) returns (GetBatchResponse) {
14+
rpc GetCommitmentTxs(GetCommitmentTxsRequest) returns (GetCommitmentTxsResponse) {
1515
option (google.api.http) = {
16-
get: "/v1/admin/batch/{batch_id}"
16+
get: "/v1/admin/commitmentTxs"
1717
};
1818
}
19-
rpc GetBatches(GetBatchesRequest) returns (GetBatchesResponse) {
19+
rpc GetScheduledSweep(GetScheduledSweepRequest) returns (GetScheduledSweepResponse) {
2020
option (google.api.http) = {
21-
post: "/v1/admin/batches"
22-
body: "*"
21+
get: "/v1/admin/sweeps"
2322
};
24-
}
23+
}
2524
rpc CreateNote(CreateNoteRequest) returns (CreateNoteResponse) {
2625
option (google.api.http) = {
2726
post: "/v1/admin/note"
@@ -39,40 +38,43 @@ service AdminService {
3938
body: "*"
4039
};
4140
}
42-
rpc GetTxRequestQueue(GetTxRequestQueueRequest) returns (GetTxRequestQueueResponse) {
41+
rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) {
4342
option (google.api.http) = {
44-
get: "/v1/admin/queue"
43+
get: "/v1/admin/intents"
4544
};
4645
}
47-
rpc DeleteTxRequests(DeleteTxRequestsRequest) returns (DeleteTxRequestsResponse) {
46+
rpc DeleteIntents(DeleteIntentsRequest) returns (DeleteIntentsResponse) {
4847
option (google.api.http) = {
49-
post: "/v1/admin/queue/delete"
48+
post: "/v1/admin/intents/delete"
5049
body: "*"
5150
};
5251
}
5352
}
5453

55-
message GetScheduledSweepRequest {}
56-
message GetScheduledSweepResponse {
57-
repeated ScheduledSweep sweeps = 1;
54+
message GetCommitmentTxInfoRequest {
55+
string id = 1;
56+
}
57+
message GetCommitmentTxInfoResponse {
58+
oneof commitment_tx {
59+
CommitmentTxCompleted success = 1;
60+
CommitmentTxFailed failure = 2;
61+
}
5862
}
5963

60-
message GetBatchRequest {
61-
string batch_id = 1;
64+
message GetCommitmentTxsRequest {
65+
int64 before = 1;
66+
int64 after = 2;
6267
}
63-
message GetBatchResponse {
64-
oneof batch {
65-
BatchCompleted success = 1;
66-
BatchFailed failure = 2;
67-
}
68+
message GetCommitmentTxsResponse {
69+
repeated string ids = 1;
6870
}
6971

70-
message GetBatchesRequest {
71-
int64 after = 1;
72-
int64 before = 2;
72+
message GetScheduledSweepRequest {
73+
PageRequest page = 1;
7374
}
74-
message GetBatchesResponse {
75-
repeated string batch_ids = 1;
75+
message GetScheduledSweepResponse {
76+
repeated ScheduledSweep sweeps = 1;
77+
PageResponse page = 2;
7678
}
7779

7880
message CreateNoteRequest {
@@ -85,22 +87,101 @@ message CreateNoteResponse {
8587

8688
message GetMarketHourRequest {}
8789
message GetMarketHourResponse {
88-
MarketHourConfig market_hour_config = 1;
90+
MarketHourConfig market_hour = 1;
8991
}
9092

9193
message UpdateMarketHourRequest {
92-
MarketHourConfig market_hour_config = 1;
94+
MarketHourConfig market_hour = 1;
9395
}
9496
message UpdateMarketHourResponse {}
9597

96-
message GetTxRequestQueueRequest {
97-
repeated string request_ids = 1;
98+
message ListIntentsRequest {
99+
repeated string intent_ids = 1;
100+
}
101+
message ListIntentsResponse {
102+
repeated Intent intents = 1;
103+
}
104+
105+
message DeleteIntentsRequest {
106+
repeated string intent_ids = 1;
107+
}
108+
message DeleteIntentsResponse {}
109+
110+
enum BatchStage {
111+
BATCH_STAGE_UNSPECIFIED = 0;
112+
BATCH_STAGE_REGISTRATION = 1;
113+
BATCH_STAGE_FINALIZATION = 2;
114+
BATCH_STAGE_FINALIZED = 3;
115+
BATCH_STAGE_FAILED = 4;
116+
}
117+
118+
message BatchSuccess {
119+
uint64 total_forfeit_amount = 1;
120+
uint64 total_boarding_amount = 2;
121+
uint64 total_batch_amount = 3;
122+
uint64 total_exit_amount = 4;
123+
uint64 total_fee_amount = 5;
124+
repeated Outpoint input_vtxos = 6;
125+
repeated Outpoint boarding_utxos = 7;
126+
repeated Outpoint output_vtxos = 8;
127+
repeated Outpoint collaborative_exit_utxos = 9;
128+
bool swept = 10;
129+
int64 swept_at = 11;
130+
repeated string swept_by = 12;
131+
int64 sweep_scheduled_at = 13;
132+
}
133+
134+
message BatchFailed {
135+
BatchStage stage = 1;
136+
string reason = 2;
137+
}
138+
139+
message CommitmentTxCompleted {
140+
string id = 1;
141+
string commitment_txid = 2;
142+
string commitment_tx = 3;
143+
int64 started_at = 4;
144+
int64 ended_at = 5;
145+
map<uint32, BatchSuccess> batches = 6;
146+
}
147+
148+
message CommitmentTxFailed {
149+
string id = 1;
150+
int64 started_at = 4;
151+
int64 ended_at = 5;
152+
map<uint32, BatchFailed> batches = 6;
153+
}
154+
155+
message MarketHourConfig {
156+
int64 start_time = 1;
157+
int64 end_time = 2;
158+
int64 period = 3;
159+
int64 round_interval = 4;
98160
}
99-
message GetTxRequestQueueResponse {
100-
repeated TxRequestInfo requests = 1;
161+
162+
message ScheduledSweep {
163+
string batch_id = 1;
164+
string commitment_txid = 2;
165+
int32 num_transactions_to_broadcast = 3;
166+
uint64 amount_to_sweep = 4;
167+
int64 scheduled_start_time = 5;
168+
int64 expected_end_time = 6;
101169
}
102170

103-
message DeleteTxRequestsRequest {
104-
repeated string request_ids = 1;
171+
message IntentInput {
172+
string txid = 1;
173+
uint32 vout = 2;
174+
uint64 amount = 3;
105175
}
106-
message DeleteTxRequestsResponse {}
176+
177+
message Intent {
178+
string id = 1;
179+
int64 created_at = 2;
180+
repeated Output receivers = 3;
181+
repeated IntentInput inputs = 4;
182+
repeated IntentInput boarding_inputs = 5;
183+
repeated string notes = 6;
184+
string signing_type = 7;
185+
repeated string cosigners_public_keys = 8;
186+
int64 last_ping = 9;
187+
}

api-spec/protobuf/ark/v1/explorer.proto

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "google/api/annotations.proto";
66
import "ark/v1/types.proto";
77

88
service ExplorerService {
9-
rpc GetCommitmentTxInfo(GetCommitmentTxInfoRequest) returns (GetCommitmentTxInfoResponse) {
9+
rpc GetCommitmentTx(GetCommitmentTxRequest) returns (GetCommitmentTxResponse) {
1010
option (google.api.http) = {
1111
get: "/v1/commitmentTx/{txid}"
1212
};
@@ -36,18 +36,27 @@ service ExplorerService {
3636
get: "/v1/history/{address}"
3737
};
3838
};
39-
rpc GetTransactionChain(GetTransactionChainRequest) returns (GetTransactionChainResponse) {
39+
rpc GetVtxoChain(GetVtxoChainRequest) returns (GetVtxoChainResponse) {
4040
option (google.api.http) = {
4141
get: "/v1/vtxo/{outpoint.txid}/{outpoint.vout}/chain"
4242
};
4343
}
44+
rpc GetVirtualTxs(GetVirtualTxsRequest) returns (GetVirtualTxsResponse) {
45+
option (google.api.http) = {
46+
get: "/v1/virtualTx/{txids}"
47+
};
48+
}
49+
rpc GetSweptCommitmentTx(GetSweptCommitmentTxRequest) returns (GetSweptCommitmentTxResponse) {
50+
option (google.api.http) = {
51+
get: "/v1/commitmentTx/{txid}/swept"
52+
};
53+
}
4454
}
4555

46-
message GetCommitmentTxInfoRequest {
56+
message GetCommitmentTxRequest {
4757
string txid = 1;
4858
}
49-
message GetCommitmentTxInfoResponse {
50-
string tx = 1;
59+
message GetCommitmentTxResponse {
5160
int64 started_at = 2;
5261
int64 ended_at = 3;
5362
map<uint32, Batch> batches = 4;
@@ -58,7 +67,7 @@ message GetVtxoTreeRequest {
5867
PageRequest page = 2;
5968
}
6069
message GetVtxoTreeResponse {
61-
repeated FlatNode vtxo_tree = 1;
70+
repeated Node vtxo_tree = 1;
6271
PageResponse page = 2;
6372
}
6473

@@ -76,7 +85,7 @@ message GetConnectorsRequest {
7685
PageRequest page = 2;
7786
}
7887
message GetConnectorsResponse {
79-
repeated FlatNode connectors = 1;
88+
repeated Node connectors = 1;
8089
PageResponse page = 2;
8190
}
8291

@@ -100,11 +109,31 @@ message GetTransactionHistoryResponse {
100109
PageResponse page = 2;
101110
}
102111

103-
message GetTransactionChainRequest {
112+
message GetVtxoChainRequest {
104113
Outpoint outpoint = 1;
105114
PageRequest page = 2;
106115
}
107-
message GetTransactionChainResponse {
116+
message GetVtxoChainResponse {
117+
map<string, Transactions> graph = 1;
118+
PageResponse page = 2;
119+
}
120+
121+
message GetVirtualTxsRequest {
122+
repeated string txids = 1;
123+
PageRequest page = 2;
124+
}
125+
message GetVirtualTxsResponse {
108126
repeated string txs = 1;
109127
PageResponse page = 2;
128+
}
129+
130+
message GetSweptCommitmentTxRequest {
131+
string txid = 1;
132+
}
133+
message GetSweptCommitmentTxResponse {
134+
repeated string swept_by = 1;
135+
}
136+
137+
message Transactions {
138+
repeated string txs = 1;
110139
}

0 commit comments

Comments
 (0)