@@ -149,13 +149,13 @@ var timeout = time.Minute
149
149
150
150
func walletStatusAction (ctx * cli.Context ) error {
151
151
baseURL := ctx .String (urlFlagName )
152
- _ , tlsCertPath , err := getCredentialPaths (ctx )
152
+ _ , tlsConfig , err := getCredentials (ctx )
153
153
if err != nil {
154
154
return err
155
155
}
156
156
157
157
url := fmt .Sprintf ("%s/v1/admin/wallet/status" , baseURL )
158
- status , err := getStatus (url , tlsCertPath )
158
+ status , err := getStatus (url , tlsConfig )
159
159
if err != nil {
160
160
return err
161
161
}
@@ -166,7 +166,7 @@ func walletStatusAction(ctx *cli.Context) error {
166
166
167
167
func walletCreateOrRestoreAction (ctx * cli.Context ) error {
168
168
baseURL := ctx .String (urlFlagName )
169
- _ , tlsCertPath , err := getCredentialPaths (ctx )
169
+ _ , tlsConfig , err := getCredentials (ctx )
170
170
if err != nil {
171
171
return err
172
172
}
@@ -181,7 +181,7 @@ func walletCreateOrRestoreAction(ctx *cli.Context) error {
181
181
`{"seed": "%s", "password": "%s", "gap_limit": %d}` ,
182
182
mnemonic , password , gapLimit ,
183
183
)
184
- if _ , err := post [struct {}](url , body , "" , "" , tlsCertPath ); err != nil {
184
+ if _ , err := post [struct {}](url , body , "" , "" , tlsConfig ); err != nil {
185
185
return err
186
186
}
187
187
@@ -190,7 +190,7 @@ func walletCreateOrRestoreAction(ctx *cli.Context) error {
190
190
}
191
191
192
192
url := fmt .Sprintf ("%s/v1/admin/wallet/seed" , baseURL )
193
- seed , err := get [string ](url , "seed" , "" , tlsCertPath )
193
+ seed , err := get [string ](url , "seed" , "" , tlsConfig )
194
194
if err != nil {
195
195
return err
196
196
}
@@ -199,7 +199,7 @@ func walletCreateOrRestoreAction(ctx *cli.Context) error {
199
199
body := fmt .Sprintf (
200
200
`{"seed": "%s", "password": "%s"}` , seed , password ,
201
201
)
202
- if _ , err := post [struct {}](url , body , "" , "" , tlsCertPath ); err != nil {
202
+ if _ , err := post [struct {}](url , body , "" , "" , tlsConfig ); err != nil {
203
203
return err
204
204
}
205
205
@@ -215,7 +215,7 @@ func walletDropWtxmgrAction(ctx *cli.Context) error {
215
215
216
216
func walletUnlockAction (ctx * cli.Context ) error {
217
217
baseURL := ctx .String (urlFlagName )
218
- _ , tlsCertPath , err := getCredentialPaths (ctx )
218
+ _ , tlsConfig , err := getCredentials (ctx )
219
219
if err != nil {
220
220
return err
221
221
}
@@ -224,7 +224,7 @@ func walletUnlockAction(ctx *cli.Context) error {
224
224
url := fmt .Sprintf ("%s/v1/admin/wallet/unlock" , baseURL )
225
225
body := fmt .Sprintf (`{"password": "%s"}` , password )
226
226
227
- if _ , err := post [struct {}](url , body , "" , "" , tlsCertPath ); err != nil {
227
+ if _ , err := post [struct {}](url , body , "" , "" , tlsConfig ); err != nil {
228
228
return err
229
229
}
230
230
@@ -234,13 +234,13 @@ func walletUnlockAction(ctx *cli.Context) error {
234
234
235
235
func walletAddressAction (ctx * cli.Context ) error {
236
236
baseURL := ctx .String (urlFlagName )
237
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
237
+ macaroon , tlsConfig , err := getCredentials (ctx )
238
238
if err != nil {
239
239
return err
240
240
}
241
241
242
242
url := fmt .Sprintf ("%s/v1/admin/wallet/address" , baseURL )
243
- addr , err := get [string ](url , "address" , macaroon , tlsCertPath )
243
+ addr , err := get [string ](url , "address" , macaroon , tlsConfig )
244
244
if err != nil {
245
245
return err
246
246
}
@@ -251,13 +251,13 @@ func walletAddressAction(ctx *cli.Context) error {
251
251
252
252
func walletBalanceAction (ctx * cli.Context ) error {
253
253
baseURL := ctx .String (urlFlagName )
254
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
254
+ macaroon , tlsConfig , err := getCredentials (ctx )
255
255
if err != nil {
256
256
return err
257
257
}
258
258
259
259
url := fmt .Sprintf ("%s/v1/admin/wallet/balance" , baseURL )
260
- balance , err := getBalance (url , macaroon , tlsCertPath )
260
+ balance , err := getBalance (url , macaroon , tlsConfig )
261
261
if err != nil {
262
262
return err
263
263
}
@@ -270,7 +270,7 @@ func walletWithdrawAction(ctx *cli.Context) error {
270
270
baseURL := ctx .String (urlFlagName )
271
271
amount := ctx .Float64 (amountFlagName )
272
272
address := ctx .String (addressFlagName )
273
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
273
+ macaroon , tlsConfig , err := getCredentials (ctx )
274
274
if err != nil {
275
275
return err
276
276
}
@@ -279,7 +279,7 @@ func walletWithdrawAction(ctx *cli.Context) error {
279
279
amountInSats := uint64 (amount * ONE_BTC )
280
280
body := fmt .Sprintf (`{"address": "%s", "amount": %d}` , address , amountInSats )
281
281
282
- txid , err := post [string ](url , body , "txid" , macaroon , tlsCertPath )
282
+ txid , err := post [string ](url , body , "txid" , macaroon , tlsConfig )
283
283
if err != nil {
284
284
return err
285
285
}
@@ -299,7 +299,7 @@ func signerLoadAction(ctx *cli.Context) error {
299
299
if signerKey != "" && signerUrl != "" {
300
300
return fmt .Errorf ("private key and url are mutually esclusive, only one must be provided" )
301
301
}
302
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
302
+ macaroon , tlsConfig , err := getCredentials (ctx )
303
303
if err != nil {
304
304
return err
305
305
}
@@ -310,7 +310,7 @@ func signerLoadAction(ctx *cli.Context) error {
310
310
body = fmt .Sprintf (`{"signerPrivateKey": "%s"}` , signerKey )
311
311
}
312
312
313
- if _ , err := post [struct {}](url , body , "" , macaroon , tlsCertPath ); err != nil {
313
+ if _ , err := post [struct {}](url , body , "" , macaroon , tlsConfig ); err != nil {
314
314
return err
315
315
}
316
316
@@ -331,15 +331,15 @@ func createNoteAction(ctx *cli.Context) error {
331
331
baseURL := ctx .String (urlFlagName )
332
332
amount := ctx .Uint (amountFlagName )
333
333
quantity := ctx .Uint (quantityFlagName )
334
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
334
+ macaroon , tlsConfig , err := getCredentials (ctx )
335
335
if err != nil {
336
336
return err
337
337
}
338
338
339
339
url := fmt .Sprintf ("%s/v1/admin/note" , baseURL )
340
340
body := fmt .Sprintf (`{"amount": %d, "quantity": %d}` , amount , quantity )
341
341
342
- notes , err := post [[]string ](url , body , "notes" , macaroon , tlsCertPath )
342
+ notes , err := post [[]string ](url , body , "notes" , macaroon , tlsConfig )
343
343
if err != nil {
344
344
return err
345
345
}
@@ -353,7 +353,7 @@ func createNoteAction(ctx *cli.Context) error {
353
353
354
354
func listIntentsAction (ctx * cli.Context ) error {
355
355
baseURL := ctx .String (urlFlagName )
356
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
356
+ macaroon , tlsConfig , err := getCredentials (ctx )
357
357
if err != nil {
358
358
return err
359
359
}
@@ -368,7 +368,7 @@ func listIntentsAction(ctx *cli.Context) error {
368
368
q .Set ("intent_ids" , strings .Join (requestIds , "," ))
369
369
u .RawQuery = q .Encode ()
370
370
}
371
- response , err := get [[]map [string ]any ](u .String (), "intents" , macaroon , tlsCertPath )
371
+ response , err := get [[]map [string ]any ](u .String (), "intents" , macaroon , tlsConfig )
372
372
if err != nil {
373
373
return err
374
374
}
@@ -383,7 +383,7 @@ func listIntentsAction(ctx *cli.Context) error {
383
383
384
384
func deleteIntentsAction (ctx * cli.Context ) error {
385
385
baseURL := ctx .String (urlFlagName )
386
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
386
+ macaroon , tlsConfig , err := getCredentials (ctx )
387
387
if err != nil {
388
388
return err
389
389
}
@@ -397,7 +397,7 @@ func deleteIntentsAction(ctx *cli.Context) error {
397
397
url := fmt .Sprintf ("%s/v1/admin/intents/delete" , baseURL )
398
398
body := fmt .Sprintf (`{"intent_ids": %s}` , intentIdsJSON )
399
399
400
- if _ , err := post [struct {}](url , body , "" , macaroon , tlsCertPath ); err != nil {
400
+ if _ , err := post [struct {}](url , body , "" , macaroon , tlsConfig ); err != nil {
401
401
return err
402
402
}
403
403
@@ -407,15 +407,15 @@ func deleteIntentsAction(ctx *cli.Context) error {
407
407
408
408
func clearIntentsAction (ctx * cli.Context ) error {
409
409
baseURL := ctx .String (urlFlagName )
410
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
410
+ macaroon , tlsConfig , err := getCredentials (ctx )
411
411
if err != nil {
412
412
return err
413
413
}
414
414
415
415
url := fmt .Sprintf ("%s/v1/admin/intents/delete" , baseURL )
416
416
body := `{"intent_ids": []}`
417
417
418
- if _ , err := post [struct {}](url , body , "" , macaroon , tlsCertPath ); err != nil {
418
+ if _ , err := post [struct {}](url , body , "" , macaroon , tlsConfig ); err != nil {
419
419
return err
420
420
}
421
421
@@ -425,14 +425,14 @@ func clearIntentsAction(ctx *cli.Context) error {
425
425
426
426
func scheduledSweepAction (ctx * cli.Context ) error {
427
427
baseURL := ctx .String (urlFlagName )
428
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
428
+ macaroon , tlsConfig , err := getCredentials (ctx )
429
429
if err != nil {
430
430
return err
431
431
}
432
432
433
433
url := fmt .Sprintf ("%s/v1/admin/sweeps" , baseURL )
434
434
435
- resp , err := get [[]map [string ]any ](url , "sweeps" , macaroon , tlsCertPath )
435
+ resp , err := get [[]map [string ]any ](url , "sweeps" , macaroon , tlsConfig )
436
436
if err != nil {
437
437
return err
438
438
}
@@ -448,14 +448,14 @@ func scheduledSweepAction(ctx *cli.Context) error {
448
448
func roundInfoAction (ctx * cli.Context ) error {
449
449
baseURL := ctx .String (urlFlagName )
450
450
roundId := ctx .String (roundIdFlagName )
451
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
451
+ macaroon , tlsConfig , err := getCredentials (ctx )
452
452
if err != nil {
453
453
return err
454
454
}
455
455
456
456
url := fmt .Sprintf ("%s/v1/admin/round/%s" , baseURL , roundId )
457
457
458
- resp , err := getRoundInfo (url , macaroon , tlsCertPath )
458
+ resp , err := getRoundInfo (url , macaroon , tlsConfig )
459
459
if err != nil {
460
460
return err
461
461
}
@@ -472,7 +472,7 @@ func roundsInTimeRangeAction(ctx *cli.Context) error {
472
472
baseURL := ctx .String (urlFlagName )
473
473
beforeDate := ctx .String (beforeDateFlagName )
474
474
afterDate := ctx .String (afterDateFlagName )
475
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
475
+ macaroon , tlsConfig , err := getCredentials (ctx )
476
476
if err != nil {
477
477
return err
478
478
}
@@ -497,7 +497,7 @@ func roundsInTimeRangeAction(ctx *cli.Context) error {
497
497
}
498
498
}
499
499
500
- roundIds , err := get [map [string ]string ](url , "rounds" , macaroon , tlsCertPath )
500
+ roundIds , err := get [map [string ]string ](url , "rounds" , macaroon , tlsConfig )
501
501
if err != nil {
502
502
return err
503
503
}
@@ -512,14 +512,14 @@ func roundsInTimeRangeAction(ctx *cli.Context) error {
512
512
513
513
func getMarketHourAction (ctx * cli.Context ) error {
514
514
baseURL := ctx .String (urlFlagName )
515
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
515
+ macaroon , tlsConfig , err := getCredentials (ctx )
516
516
if err != nil {
517
517
return err
518
518
}
519
519
520
520
url := fmt .Sprintf ("%s/v1/admin/marketHour" , baseURL )
521
521
522
- resp , err := get [map [string ]string ](url , "config" , macaroon , tlsCertPath )
522
+ resp , err := get [map [string ]string ](url , "config" , macaroon , tlsConfig )
523
523
if err != nil {
524
524
return err
525
525
}
@@ -570,7 +570,7 @@ func updateMarketHourAction(ctx *cli.Context) error {
570
570
return fmt .Errorf ("--start-date and --end-date must be set together" )
571
571
}
572
572
573
- macaroon , tlsCertPath , err := getCredentialPaths (ctx )
573
+ macaroon , tlsConfig , err := getCredentials (ctx )
574
574
if err != nil {
575
575
return err
576
576
}
@@ -600,7 +600,7 @@ func updateMarketHourAction(ctx *cli.Context) error {
600
600
if err != nil {
601
601
return fmt .Errorf ("failed to encode request body: %s" , err )
602
602
}
603
- if _ , err := post [any ](url , string (body ), "" , macaroon , tlsCertPath ); err != nil {
603
+ if _ , err := post [any ](url , string (body ), "" , macaroon , tlsConfig ); err != nil {
604
604
return err
605
605
}
606
606
0 commit comments