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

[CO-328] Add missing '--client' option in cURL API doc examples #3212

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions wallet-new/src/Cardano/Wallet/API/V1/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ You can create your first wallet using the [`POST /api/v1/wallets`](#tag/Wallets
curl -X POST https://localhost:8090/api/v1/wallets \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
--cert ./scripts/tls-files/client.pem \
--cacert ./scripts/tls-files/ca.crt \
-d '{
"operation": "create",
Expand Down Expand Up @@ -327,7 +328,8 @@ endpoint as follows:
```
curl -X GET https://localhost:8090/api/v1/wallets/{{walletId}} \
-H "Accept: application/json; charset=utf-8" \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

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

Since you have, for now, only a single wallet, you'll see something like this:
Expand All @@ -366,6 +369,7 @@ curl -X POST https://localhost:8090/api/v1/transactions \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem \
-d '{
"destinations": [{
"amount": 14,
Expand All @@ -392,6 +396,7 @@ endpoint as follows:
curl -X GET https://localhost:8090/api/v1/transactions?wallet_id=Ae2tdPwUPE...8V3AVTnqGZ\
-H "Accept: application/json; charset=utf-8" \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

Here we constrained the request to a specific account. After our previous transaction the output
Expand Down Expand Up @@ -546,6 +551,7 @@ curl -X POST https://localhost:8090/api/v1/transactions \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem \
-d '{
"destinations": [
{
Expand Down Expand Up @@ -582,6 +588,7 @@ curl -X POST https://localhost:8090/api/v1/transactions/fees \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem \
-d '{
"destinations": [{
"amount": 14,
Expand Down Expand Up @@ -617,6 +624,7 @@ curl -X POST \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem \
-d '{
"name": "MyOtherAccount",
"spendingPassword": "5416b2988745725998907addf4613c9b0764f04959030e1b81c603b920a115d0"
Expand All @@ -639,15 +647,17 @@ For example:
curl -X GET \
https://127.0.0.1:8090/api/v1/wallets/Ae2tdPwUPE...8V3AVTnqGZ/accounts/2902829384 \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

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)
```
curl -X GET \
https://127.0.0.1:8090/api/v1/wallets/Ae2tdPwUPE...8V3AVTnqGZ/accounts \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

```json
Expand Down Expand Up @@ -675,6 +685,7 @@ curl -X POST \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem \
-d '{
"walletId": "Ae2tdPwUPE...V3AVTnqGZ4",
"accountIndex": 2147483648
Expand All @@ -699,7 +710,8 @@ You can always view all your available addresses across all your wallets by usin
```
curl -X GET https://localhost:8090/api/v1/addresses \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

```json
Expand All @@ -716,7 +728,8 @@ rather verbose and gives real-time progress updates about the current node.
```
curl -X GET https://localhost:8090/api/v1/node-info \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

```json
Expand Down Expand Up @@ -748,14 +761,16 @@ ordered by descending date:
```
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' \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```
For example, in order to retrieve the last 50 transactions, ordered by descending date:

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


Expand All @@ -764,7 +779,8 @@ Another example, if you were to look for all transactions made since the 1st of
```
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\]' \
-H 'Accept: application/json;charset=utf-8' \
--cacert ./scripts/tls-files/ca.crt
--cacert ./scripts/tls-files/ca.crt \
--cert ./scripts/tls-files/client.pem
```

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