Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit bf70d0f

Browse files
committed
Merge pull request #3212 from input-output-hk/KtorZ/CO-328/missing-curl-options-in-api-doc
[CO-328] Add missing '--client' option in cURL API doc examples
2 parents be091ce + cb623a9 commit bf70d0f

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

wallet-new/src/Cardano/Wallet/API/V1/Swagger.hs

+25-9
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ You can create your first wallet using the [`POST /api/v1/wallets`](#tag/Wallets
280280
curl -X POST https://localhost:8090/api/v1/wallets \
281281
-H "Accept: application/json; charset=utf-8" \
282282
-H "Content-Type: application/json; charset=utf-8" \
283+
--cert ./scripts/tls-files/client.pem \
283284
--cacert ./scripts/tls-files/ca.crt \
284285
-d '{
285286
"operation": "create",
@@ -325,7 +326,8 @@ endpoint as follows:
325326
```
326327
curl -X GET https://localhost:8090/api/v1/wallets/{{walletId}} \
327328
-H "Accept: application/json; charset=utf-8" \
328-
--cacert ./scripts/tls-files/ca.crt
329+
--cacert ./scripts/tls-files/ca.crt \
330+
--cert ./scripts/tls-files/client.pem
329331
```
330332

331333
Receiving ADA
@@ -339,7 +341,8 @@ endpoint:
339341
```
340342
curl -X GET https://localhost:8090/api/v1/wallets/{{walletId}}/accounts?page=1&per_page=10 \
341343
-H "Accept: application/json; charset=utf-8" \
342-
--cacert ./scripts/tls-files/ca.crt
344+
--cacert ./scripts/tls-files/ca.crt \
345+
--cert ./scripts/tls-files/client.pem
343346
```
344347

345348
Since you have, for now, only a single wallet, you'll see something like this:
@@ -364,6 +367,7 @@ curl -X POST https://localhost:8090/api/v1/transactions \
364367
-H "Accept: application/json; charset=utf-8" \
365368
-H "Content-Type: application/json; charset=utf-8" \
366369
--cacert ./scripts/tls-files/ca.crt \
370+
--cert ./scripts/tls-files/client.pem \
367371
-d '{
368372
"destinations": [{
369373
"amount": 14,
@@ -390,6 +394,7 @@ endpoint as follows:
390394
curl -X GET https://localhost:8090/api/v1/transactions?wallet_id=Ae2tdPwUPE...8V3AVTnqGZ\
391395
-H "Accept: application/json; charset=utf-8" \
392396
--cacert ./scripts/tls-files/ca.crt \
397+
--cert ./scripts/tls-files/client.pem
393398
```
394399

395400
Here we constrained the request to a specific account. After our previous transaction the output
@@ -544,6 +549,7 @@ curl -X POST https://localhost:8090/api/v1/transactions \
544549
-H "Accept: application/json; charset=utf-8" \
545550
-H "Content-Type: application/json; charset=utf-8" \
546551
--cacert ./scripts/tls-files/ca.crt \
552+
--cert ./scripts/tls-files/client.pem \
547553
-d '{
548554
"destinations": [
549555
{
@@ -580,6 +586,7 @@ curl -X POST https://localhost:8090/api/v1/transactions/fees \
580586
-H "Accept: application/json; charset=utf-8" \
581587
-H "Content-Type: application/json; charset=utf-8" \
582588
--cacert ./scripts/tls-files/ca.crt \
589+
--cert ./scripts/tls-files/client.pem \
583590
-d '{
584591
"destinations": [{
585592
"amount": 14,
@@ -615,6 +622,7 @@ curl -X POST \
615622
-H 'Content-Type: application/json;charset=utf-8' \
616623
-H 'Accept: application/json;charset=utf-8' \
617624
--cacert ./scripts/tls-files/ca.crt \
625+
--cert ./scripts/tls-files/client.pem \
618626
-d '{
619627
"name": "MyOtherAccount",
620628
"spendingPassword": "5416b2988745725998907addf4613c9b0764f04959030e1b81c603b920a115d0"
@@ -637,15 +645,17 @@ For example:
637645
curl -X GET \
638646
https://127.0.0.1:8090/api/v1/wallets/Ae2tdPwUPE...8V3AVTnqGZ/accounts/2902829384 \
639647
-H 'Accept: application/json;charset=utf-8' \
640-
--cacert ./scripts/tls-files/ca.crt
648+
--cacert ./scripts/tls-files/ca.crt \
649+
--cert ./scripts/tls-files/client.pem
641650
```
642651

643652
For a broader view, the full list of accounts of a given wallet can be retrieved using [`GET /api/v1/wallets/{{walletId}}/accounts`](#tag/Accounts%2Fpaths%2F~1api~1v1~1wallets~1{walletId}~1accounts%2Fget)
644653
```
645654
curl -X GET \
646655
https://127.0.0.1:8090/api/v1/wallets/Ae2tdPwUPE...8V3AVTnqGZ/accounts \
647656
-H 'Accept: application/json;charset=utf-8' \
648-
--cacert ./scripts/tls-files/ca.crt
657+
--cacert ./scripts/tls-files/ca.crt \
658+
--cert ./scripts/tls-files/client.pem
649659
```
650660

651661
```json
@@ -673,6 +683,7 @@ curl -X POST \
673683
-H 'Content-Type: application/json;charset=utf-8' \
674684
-H 'Accept: application/json;charset=utf-8' \
675685
--cacert ./scripts/tls-files/ca.crt \
686+
--cert ./scripts/tls-files/client.pem \
676687
-d '{
677688
"walletId": "Ae2tdPwUPE...V3AVTnqGZ4",
678689
"accountIndex": 2147483648
@@ -697,7 +708,8 @@ You can always view all your available addresses across all your wallets by usin
697708
```
698709
curl -X GET https://localhost:8090/api/v1/addresses \
699710
-H 'Accept: application/json;charset=utf-8' \
700-
--cacert ./scripts/tls-files/ca.crt
711+
--cacert ./scripts/tls-files/ca.crt \
712+
--cert ./scripts/tls-files/client.pem
701713
```
702714

703715
```json
@@ -714,7 +726,8 @@ rather verbose and gives real-time progress updates about the current node.
714726
```
715727
curl -X GET https://localhost:8090/api/v1/node-info \
716728
-H 'Accept: application/json;charset=utf-8' \
717-
--cacert ./scripts/tls-files/ca.crt
729+
--cacert ./scripts/tls-files/ca.crt \
730+
--cert ./scripts/tls-files/client.pem
718731
```
719732

720733
```json
@@ -746,14 +759,16 @@ ordered by descending date:
746759
```
747760
curl -X GET https://127.0.0.1:8090/api/v1/transactions?wallet_id=Ae2tdPwU...3AVTnqGZ&account_index=2902829384&sort_by=DES\[created_at\]&per_page=50' \
748761
-H 'Accept: application/json;charset=utf-8' \
749-
--cacert ./scripts/tls-files/ca.crt
762+
--cacert ./scripts/tls-files/ca.crt \
763+
--cert ./scripts/tls-files/client.pem
750764
```
751765
For example, in order to retrieve the last 50 transactions, ordered by descending date:
752766

753767
```
754768
curl -X GET 'https://127.0.0.1:8090/api/v1/transactions?wallet_id=Ae2tdPwU...3AVTnqGZ &sort_by=DES\[created_at\]&per_page=50' \
755769
-H 'Accept: application/json;charset=utf-8' \
756-
--cacert ./scripts/tls-files/ca.crt
770+
--cacert ./scripts/tls-files/ca.crt \
771+
--cert ./scripts/tls-files/client.pem
757772
```
758773

759774

@@ -762,7 +777,8 @@ Another example, if you were to look for all transactions made since the 1st of
762777
```
763778
curl -X GET 'https://127.0.0.1:8090/api/v1/transactions?wallet_id=Ae2tdPwU...3AVTnqGZ&created_at=GT\[2018-01-01T00:00:00.00000\]' \
764779
-H 'Accept: application/json;charset=utf-8' \
765-
--cacert ./scripts/tls-files/ca.crt
780+
--cacert ./scripts/tls-files/ca.crt \
781+
--cert ./scripts/tls-files/client.pem
766782
```
767783

768784
Make sure to carefully read the section about [Pagination](#section/Pagination) to fully

0 commit comments

Comments
 (0)