Skip to content

Instantly share code, notes, and snippets.

@p-alik
Last active September 10, 2020 07:36
Show Gist options
  • Save p-alik/e22f8addd9e6cdd4f8e688dd73ddb82f to your computer and use it in GitHub Desktop.
Save p-alik/e22f8addd9e6cdd4f8e688dd73ddb82f to your computer and use it in GitHub Desktop.
list accounts, list wallet transactions history
# https://cardanodocs.com/technical/wallet/api/
# create a new wallet
$ curl -H "Content-Type: application/json" --cacert cardano-sl/scripts/tls-files/ca.crt https://localhost:8090/api/wallets/new -d '{
"cwInitMeta": {
"cwName": "my-cardano-wallet",
"cwAssurance": "CWAStrict",
"cwUnit": 0
},
"cwBackupPhrase": {
"bpToList": [
]
}
}'
{"Right":{"cwId":"Ae2tdPwUPEZ18ZjTLnLVr9CEvUEUX4eW1LBHbxxxJgxdAYHrDeSCSbCxrvx","cwMeta":{"cwName":"my-cardano-wallet","cwAssurance":"CWAStrict","cwUnit":0},"cwAccountsNumber":1,"cwAmount":{"getCCoin":"0"},"cwHasPassphrase":false,"cwPassphraseLU":1.514813538881684483e9}}
# list wallets
$ curl -H "Content-Type: application/json" --cacert cardano-sl/scripts/tls-files/ca.crt https://localhost:8090/api/wallets
{"Right":[{"cwId":"Ae2tdPwUPEZ18ZjTLnLVr9CEvUEUX4eW1LBHbxxxJgxdAYHrDeSCSbCxrvx","cwMeta":{"cwName":"my-cardano-wallet","cwAssurance":"CWAStrict","cwUnit":0},"cwAccountsNumber":1,"cwAmount":{"getCCoin":"0"},"cwHasPassphrase":false,"cwPassphraseLU":1.514813538881684483e9}]}
# delete wallet
$ curl -XDELETE -H "Content-Type: application/json" --cacert cardano-sl/scripts/tls-files/ca.crt https://localhost:8090/api/wallets/Ae2tdPwUPEZ18ZjTLnLVr9CEvUEUX4eW1LBHbxxxJgxdAYHrDeSCSbCxrvx
{"Right":[]}
# list accounts
curl -k -H "Content-Type: application/json" --cacert scripts/tls-files/ca.crt https://localhost:8090/api/account
# wallet transactions history
curl -k -H "Content-Type: application/json" --cacert scripts/tls-files/ca.crt https://localhost:8090/api/txs/histories?walletId=YOUR-WALLET-ID
@tanzeelrana
Copy link

How do i perform the above operation in javascript ?

@tanzeelrana
Copy link

I can not add the certificate file in my javascript post request :(

@p-alik
Copy link
Author

p-alik commented Jan 7, 2018

How do i perform the above operation in javascript ?

I never did it, but it looks like, you could use swagger editor to generate code for the language of your choice. See Playing with the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment