Skip to content

Commit 7c5dbb5

Browse files
committed
Update indexer grpc and rest clients
1 parent 31e1dab commit 7c5dbb5

10 files changed

+107
-129
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (a *grpcClient) GetVtxoTreeLeaves(
197197
}
198198

199199
func (a *grpcClient) GetForfeitTxs(
200-
ctx context.Context, batchOutpoint indexer.Outpoint, opts ...indexer.RequestOption,
200+
ctx context.Context, txid string, opts ...indexer.RequestOption,
201201
) (*indexer.ForfeitTxsResponse, error) {
202202
var page *arkv1.IndexerPageRequest
203203
if len(opts) > 0 {
@@ -209,10 +209,7 @@ func (a *grpcClient) GetForfeitTxs(
209209
}
210210

211211
req := &arkv1.GetForfeitTxsRequest{
212-
BatchOutpoint: &arkv1.IndexerOutpoint{
213-
Txid: batchOutpoint.Txid,
214-
Vout: batchOutpoint.VOut,
215-
},
212+
Txid: txid,
216213
Page: page,
217214
}
218215

@@ -228,7 +225,7 @@ func (a *grpcClient) GetForfeitTxs(
228225
}
229226

230227
func (a *grpcClient) GetConnectors(
231-
ctx context.Context, batchOutpoint indexer.Outpoint, opts ...indexer.RequestOption,
228+
ctx context.Context, txid string, opts ...indexer.RequestOption,
232229
) (*indexer.ConnectorsResponse, error) {
233230
var page *arkv1.IndexerPageRequest
234231
if len(opts) > 0 {
@@ -240,10 +237,7 @@ func (a *grpcClient) GetConnectors(
240237
}
241238

242239
req := &arkv1.GetConnectorsRequest{
243-
BatchOutpoint: &arkv1.IndexerOutpoint{
244-
Txid: batchOutpoint.Txid,
245-
Vout: batchOutpoint.VOut,
246-
},
240+
Txid: txid,
247241
Page: page,
248242
}
249243

@@ -269,7 +263,7 @@ func (a *grpcClient) GetConnectors(
269263
}
270264

271265
func (a *grpcClient) GetVtxos(
272-
ctx context.Context, address string, opts ...indexer.GetVtxosRequestOption,
266+
ctx context.Context, addresses []string, opts ...indexer.GetVtxosRequestOption,
273267
) (*indexer.VtxosResponse, error) {
274268
var page *arkv1.IndexerPageRequest
275269
var spendableOnly, spentOnly bool
@@ -288,7 +282,7 @@ func (a *grpcClient) GetVtxos(
288282
return nil, status.Errorf(codes.InvalidArgument, "spendableOnly and spentOnly cannot be both true")
289283
}
290284
req := &arkv1.GetVtxosRequest{
291-
Address: address,
285+
Addresses: addresses,
292286
SpendableOnly: spendableOnly,
293287
SpentOnly: spentOnly,
294288
Page: page,

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,10 @@ func (a *restClient) GetVtxoTreeLeaves(
196196
}
197197

198198
func (a *restClient) GetForfeitTxs(
199-
ctx context.Context, batchOutpoint indexer.Outpoint, opts ...indexer.RequestOption,
199+
ctx context.Context, txid string, opts ...indexer.RequestOption,
200200
) (*indexer.ForfeitTxsResponse, error) {
201201
params := indexer_service.NewIndexerServiceGetForfeitTxsParams().
202-
WithBatchOutpointTxid(batchOutpoint.Txid).
203-
WithBatchOutpointVout(int64(batchOutpoint.VOut))
202+
WithTxid(txid)
204203

205204
if len(opts) > 0 {
206205
page := opts[0].GetPage()
@@ -219,11 +218,10 @@ func (a *restClient) GetForfeitTxs(
219218
}
220219

221220
func (a *restClient) GetConnectors(
222-
ctx context.Context, batchOutpoint indexer.Outpoint, opts ...indexer.RequestOption,
221+
ctx context.Context, txid string, opts ...indexer.RequestOption,
223222
) (*indexer.ConnectorsResponse, error) {
224223
params := indexer_service.NewIndexerServiceGetConnectorsParams().
225-
WithBatchOutpointTxid(batchOutpoint.Txid).
226-
WithBatchOutpointVout(int64(batchOutpoint.VOut))
224+
WithTxid(txid)
227225

228226
if len(opts) > 0 {
229227
page := opts[0].GetPage()
@@ -252,10 +250,10 @@ func (a *restClient) GetConnectors(
252250
}
253251

254252
func (a *restClient) GetVtxos(
255-
ctx context.Context, address string, opts ...indexer.GetVtxosRequestOption,
253+
ctx context.Context, addresses []string, opts ...indexer.GetVtxosRequestOption,
256254
) (*indexer.VtxosResponse, error) {
257255
params := indexer_service.NewIndexerServiceGetVtxosParams().
258-
WithAddress(address)
256+
WithAddresses(addresses)
259257

260258
if len(opts) > 0 {
261259
if page := opts[0].GetPage(); page != nil {

pkg/client-sdk/indexer/rest/service/indexerservice/indexer_service/indexer_service_client.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client-sdk/indexer/rest/service/indexerservice/indexer_service/indexer_service_get_connectors_parameters.go

Lines changed: 19 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client-sdk/indexer/rest/service/indexerservice/indexer_service/indexer_service_get_connectors_responses.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client-sdk/indexer/rest/service/indexerservice/indexer_service/indexer_service_get_forfeit_txs_parameters.go

Lines changed: 19 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client-sdk/indexer/rest/service/indexerservice/indexer_service/indexer_service_get_forfeit_txs_responses.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)