Skip to content

Commit 3271776

Browse files
authored
Rename API fields (#337)
* Update api-spec * Update ASP (also domain to drop "pool" completely) * Update sdk * Update protos * Update asp * Update sdk * Fixes
1 parent f36a747 commit 3271776

25 files changed

+577
-579
lines changed

api-spec/openapi/swagger/ark/v1/service.swagger.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,10 @@
785785
"type": "string",
786786
"format": "int64"
787787
},
788-
"poolTx": {
788+
"roundTx": {
789789
"type": "string"
790790
},
791-
"congestionTree": {
791+
"vtxoTree": {
792792
"$ref": "#/definitions/v1Tree"
793793
},
794794
"forfeitTxs": {
@@ -825,10 +825,10 @@
825825
"id": {
826826
"type": "string"
827827
},
828-
"poolTx": {
828+
"roundTx": {
829829
"type": "string"
830830
},
831-
"congestionTree": {
831+
"vtxoTree": {
832832
"$ref": "#/definitions/v1Tree"
833833
},
834834
"connectors": {
@@ -849,7 +849,7 @@
849849
"id": {
850850
"type": "string"
851851
},
852-
"poolTxid": {
852+
"roundTxid": {
853853
"type": "string"
854854
}
855855
}
@@ -866,7 +866,7 @@
866866
"type": "string"
867867
}
868868
},
869-
"unsignedTree": {
869+
"unsignedVtxoTree": {
870870
"$ref": "#/definitions/v1Tree"
871871
},
872872
"unsignedRoundTx": {
@@ -921,7 +921,7 @@
921921
"roundId": {
922922
"type": "string"
923923
},
924-
"publicKey": {
924+
"pubkey": {
925925
"type": "string"
926926
},
927927
"treeNonces": {
@@ -938,7 +938,7 @@
938938
"roundId": {
939939
"type": "string"
940940
},
941-
"publicKey": {
941+
"pubkey": {
942942
"type": "string"
943943
},
944944
"treeSignatures": {
@@ -985,7 +985,7 @@
985985
"spent": {
986986
"type": "boolean"
987987
},
988-
"poolTxid": {
988+
"roundTxid": {
989989
"type": "string"
990990
},
991991
"spentBy": {

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ message RegisterOutputsForNextRoundResponse {}
136136

137137
message SubmitTreeNoncesRequest {
138138
string round_id = 1;
139-
string public_key = 2;
139+
string pubkey = 2;
140140
string tree_nonces = 3;
141141
}
142142
message SubmitTreeNoncesResponse {}
143143

144144
message SubmitTreeSignaturesRequest {
145145
string round_id = 1;
146-
string public_key = 2;
146+
string pubkey = 2;
147147
string tree_signatures = 3;
148148
}
149149
message SubmitTreeSignaturesResponse {}
@@ -225,15 +225,15 @@ message ListVtxosResponse {
225225

226226
message RoundFinalizationEvent {
227227
string id = 1;
228-
string pool_tx = 2;
229-
Tree congestion_tree = 3;
228+
string round_tx = 2;
229+
Tree vtxo_tree = 3;
230230
repeated string connectors = 4;
231231
int64 min_relay_fee_rate = 5;
232232
}
233233

234234
message RoundFinalizedEvent {
235235
string id = 1;
236-
string pool_txid = 2;
236+
string round_txid = 2;
237237
}
238238

239239
message RoundFailed {
@@ -244,7 +244,7 @@ message RoundFailed {
244244
message RoundSigningEvent {
245245
string id = 1;
246246
repeated string cosigners_pubkeys = 2;
247-
Tree unsigned_tree = 3;
247+
Tree unsigned_vtxo_tree = 3;
248248
string unsigned_round_tx = 4;
249249
}
250250

@@ -267,8 +267,8 @@ message Round {
267267
string id = 1;
268268
int64 start = 2;
269269
int64 end = 3;
270-
string pool_tx = 4;
271-
Tree congestion_tree = 5;
270+
string round_tx = 4;
271+
Tree vtxo_tree = 5;
272272
repeated string forfeit_txs = 6;
273273
repeated string connectors = 7;
274274
RoundStage stage = 8;
@@ -308,7 +308,7 @@ message Vtxo {
308308
Outpoint outpoint = 1;
309309
string descriptor = 2;
310310
bool spent = 3;
311-
string pool_txid = 4;
311+
string round_txid = 4;
312312
string spent_by = 5;
313313
int64 expire_at = 6;
314314
bool swept = 7;

api-spec/protobuf/gen/ark/v1/service.pb.go

+394-396
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client-sdk/client/grpc/client.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (a *grpcClient) SubmitTreeNonces(
123123

124124
req := &arkv1.SubmitTreeNoncesRequest{
125125
RoundId: roundID,
126-
PublicKey: cosignerPubkey,
126+
Pubkey: cosignerPubkey,
127127
TreeNonces: serializedNonces,
128128
}
129129

@@ -147,7 +147,7 @@ func (a *grpcClient) SubmitTreeSignatures(
147147

148148
req := &arkv1.SubmitTreeSignaturesRequest{
149149
RoundId: roundID,
150-
PublicKey: cosignerPubkey,
150+
Pubkey: cosignerPubkey,
151151
TreeSignatures: serializedSigs,
152152
}
153153

@@ -280,8 +280,8 @@ func (a *grpcClient) GetRound(
280280
ID: round.GetId(),
281281
StartedAt: &startedAt,
282282
EndedAt: endedAt,
283-
Tx: round.GetPoolTx(),
284-
Tree: treeFromProto{round.GetCongestionTree()}.parse(),
283+
Tx: round.GetRoundTx(),
284+
Tree: treeFromProto{round.GetVtxoTree()}.parse(),
285285
ForfeitTxs: round.GetForfeitTxs(),
286286
Connectors: round.GetConnectors(),
287287
Stage: client.RoundStage(int(round.GetStage())),
@@ -303,12 +303,12 @@ func (a *grpcClient) GetRoundByID(
303303
t := time.Unix(round.GetEnd(), 0)
304304
endedAt = &t
305305
}
306-
tree := treeFromProto{round.GetCongestionTree()}.parse()
306+
tree := treeFromProto{round.GetVtxoTree()}.parse()
307307
return &client.Round{
308308
ID: round.GetId(),
309309
StartedAt: &startedAt,
310310
EndedAt: endedAt,
311-
Tx: round.GetPoolTx(),
311+
Tx: round.GetRoundTx(),
312312
Tree: tree,
313313
ForfeitTxs: round.GetForfeitTxs(),
314314
Connectors: round.GetConnectors(),

pkg/client-sdk/client/grpc/types.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func (e event) toRoundEvent() (client.RoundEvent, error) {
5555
}, nil
5656
}
5757
if ee := e.GetRoundFinalization(); ee != nil {
58-
tree := treeFromProto{ee.GetCongestionTree()}.parse()
58+
tree := treeFromProto{ee.GetVtxoTree()}.parse()
5959
return client.RoundFinalizationEvent{
6060
ID: ee.GetId(),
61-
Tx: ee.GetPoolTx(),
61+
Tx: ee.GetRoundTx(),
6262
Tree: tree,
6363
Connectors: ee.GetConnectors(),
6464
MinRelayFeeRate: chainfee.SatPerKVByte(ee.MinRelayFeeRate),
@@ -68,7 +68,7 @@ func (e event) toRoundEvent() (client.RoundEvent, error) {
6868
if ee := e.GetRoundFinalized(); ee != nil {
6969
return client.RoundFinalizedEvent{
7070
ID: ee.GetId(),
71-
Txid: ee.GetPoolTxid(),
71+
Txid: ee.GetRoundTxid(),
7272
}, nil
7373
}
7474

@@ -88,7 +88,7 @@ func (e event) toRoundEvent() (client.RoundEvent, error) {
8888

8989
return client.RoundSigningStartedEvent{
9090
ID: ee.GetId(),
91-
UnsignedTree: treeFromProto{ee.GetUnsignedTree()}.parse(),
91+
UnsignedTree: treeFromProto{ee.GetUnsignedVtxoTree()}.parse(),
9292
CosignersPublicKeys: pubkeys,
9393
UnsignedRoundTx: ee.GetUnsignedRoundTx(),
9494
}, nil
@@ -130,7 +130,7 @@ func (v vtxo) toVtxo() client.Vtxo {
130130
VOut: v.GetOutpoint().GetVout(),
131131
},
132132
Amount: v.GetAmount(),
133-
RoundTxid: v.GetPoolTxid(),
133+
RoundTxid: v.GetRoundTxid(),
134134
ExpiresAt: expiresAt,
135135
Pending: v.GetPending(),
136136
RedeemTx: redeemTx,

pkg/client-sdk/client/rest/client.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (a *restClient) SubmitTreeNonces(
167167

168168
body := &models.V1SubmitTreeNoncesRequest{
169169
RoundID: roundID,
170-
PublicKey: cosignerPubkey,
170+
Pubkey: cosignerPubkey,
171171
TreeNonces: serializedNonces,
172172
}
173173

@@ -194,7 +194,7 @@ func (a *restClient) SubmitTreeSignatures(
194194

195195
body := &models.V1SubmitTreeSignaturesRequest{
196196
RoundID: roundID,
197-
PublicKey: cosignerPubkey,
197+
Pubkey: cosignerPubkey,
198198
TreeSignatures: serializedSigs,
199199
}
200200

@@ -287,7 +287,7 @@ func (a *restClient) Ping(
287287
}, nil
288288
}
289289
if e := payload.RoundFinalization; e != nil {
290-
tree := treeFromProto{e.CongestionTree}.parse()
290+
tree := treeFromProto{e.VtxoTree}.parse()
291291

292292
minRelayFeeRate, err := strconv.Atoi(e.MinRelayFeeRate)
293293
if err != nil {
@@ -296,7 +296,7 @@ func (a *restClient) Ping(
296296

297297
return client.RoundFinalizationEvent{
298298
ID: e.ID,
299-
Tx: e.PoolTx,
299+
Tx: e.RoundTx,
300300
Tree: tree,
301301
Connectors: e.Connectors,
302302
MinRelayFeeRate: chainfee.SatPerKVByte(minRelayFeeRate),
@@ -306,7 +306,7 @@ func (a *restClient) Ping(
306306
if e := payload.RoundFinalized; e != nil {
307307
return client.RoundFinalizedEvent{
308308
ID: e.ID,
309-
Txid: e.PoolTxid,
309+
Txid: e.RoundTxid,
310310
}, nil
311311
}
312312

@@ -326,7 +326,7 @@ func (a *restClient) Ping(
326326

327327
return client.RoundSigningStartedEvent{
328328
ID: e.ID,
329-
UnsignedTree: treeFromProto{e.UnsignedTree}.parse(),
329+
UnsignedTree: treeFromProto{e.UnsignedVtxoTree}.parse(),
330330
CosignersPublicKeys: pubkeys,
331331
UnsignedRoundTx: e.UnsignedRoundTx,
332332
}, nil
@@ -429,8 +429,8 @@ func (a *restClient) GetRound(
429429
ID: resp.Payload.Round.ID,
430430
StartedAt: &startedAt,
431431
EndedAt: endedAt,
432-
Tx: resp.Payload.Round.PoolTx,
433-
Tree: treeFromProto{resp.Payload.Round.CongestionTree}.parse(),
432+
Tx: resp.Payload.Round.RoundTx,
433+
Tree: treeFromProto{resp.Payload.Round.VtxoTree}.parse(),
434434
ForfeitTxs: resp.Payload.Round.ForfeitTxs,
435435
Connectors: resp.Payload.Round.Connectors,
436436
Stage: toRoundStage(*resp.Payload.Round.Stage),
@@ -468,8 +468,8 @@ func (a *restClient) GetRoundByID(
468468
ID: resp.Payload.Round.ID,
469469
StartedAt: &startedAt,
470470
EndedAt: endedAt,
471-
Tx: resp.Payload.Round.PoolTx,
472-
Tree: treeFromProto{resp.Payload.Round.CongestionTree}.parse(),
471+
Tx: resp.Payload.Round.RoundTx,
472+
Tree: treeFromProto{resp.Payload.Round.VtxoTree}.parse(),
473473
ForfeitTxs: resp.Payload.Round.ForfeitTxs,
474474
Connectors: resp.Payload.Round.Connectors,
475475
Stage: toRoundStage(*resp.Payload.Round.Stage),
@@ -516,7 +516,7 @@ func (a *restClient) ListVtxos(
516516
VOut: uint32(v.Outpoint.Vout),
517517
},
518518
Amount: uint64(amount),
519-
RoundTxid: v.PoolTxid,
519+
RoundTxid: v.RoundTxid,
520520
ExpiresAt: expiresAt,
521521
Pending: v.Pending,
522522
RedeemTx: redeemTx,
@@ -549,7 +549,7 @@ func (a *restClient) ListVtxos(
549549
VOut: uint32(v.Outpoint.Vout),
550550
},
551551
Amount: uint64(amount),
552-
RoundTxid: v.PoolTxid,
552+
RoundTxid: v.RoundTxid,
553553
ExpiresAt: expiresAt,
554554
SpentBy: v.SpentBy,
555555
Descriptor: v.Descriptor,

0 commit comments

Comments
 (0)