cardano_wallet 0.3.6 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f149bd85ed1c3a010b17f066f6c8a8e246206b0d4d8850d407119a85f41c13c8
4
- data.tar.gz: f93405819fda7d70f52ba8f9012388b872705eec927f2d8d0b33bed7a89cf465
3
+ metadata.gz: 5c14cc02d6ed07e1806787d053ba1757012cf99210aba0aa4d24945319fea0eb
4
+ data.tar.gz: f6f4cf5ba6b44c8cce833d5718f8bb5bde56ba4067c426f4b16f7881d06f2a65
5
5
  SHA512:
6
- metadata.gz: 8bb6a4745be667c10ae3d9d9710156c6ae596d4ebd6c1314e379b0e30d62c73f2bc4640e9b6925d17eac8dbdd71da50cf820a156c92b484349068beb30c53450
7
- data.tar.gz: a18defeaa4668b984d98b6518857855297215935bf20a6df293800356bd8db4e2fae694eef28b35b31cedd41d8bd2925013e1c415e1e50710a4391ae9293cf9b
6
+ metadata.gz: 582a9a4b01270bb7cba2689b2b9eee63ed605918c28ba1f982b293dabd3804607e424340cefd07c86b83a59b5ffdbecaa9ddac55c4ae630a338fc4294c113079
7
+ data.tar.gz: b6e0ca9ecfb84d3be28c617e298d5029cf81c74624420de6ee11a34817775087fe8660f67867fd4e51e57695669138100a0d47e3efb6f1b3589611d2cb5b3302
data/README.md CHANGED
@@ -6,9 +6,6 @@
6
6
  <a href="https://github.com/piotr-iohk/cardano-wallet-rb/releases">
7
7
  <img src="https://img.shields.io/github/release/piotr-iohk/cardano-wallet-rb.svg" />
8
8
  </a>
9
- <a href="https://codecov.io/gh/piotr-iohk/cardano-wallet-rb">
10
- <img src="https://codecov.io/gh/piotr-iohk/cardano-wallet-rb/branch/master/graph/badge.svg?token=OmUMUeyR21" />
11
- </a>
12
9
  <a href="https://github.com/piotr-iohk/cardano-wallet-rb/actions?query=workflow%3ATests">
13
10
  <img src="https://github.com/piotr-iohk/cardano-wallet-rb/workflows/Tests/badge.svg" />
14
11
  </a>
@@ -117,6 +117,11 @@ module CardanoWallet
117
117
  self.class.get("/byron-wallets/#{wid}/statistics/utxos")
118
118
  end
119
119
 
120
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronWalletUtxoSnapshot
121
+ def utxo_snapshot(wid)
122
+ self.class.get("/byron-wallets/#{wid}/utxo")
123
+ end
124
+
120
125
  # Update Byron wallet's passphrase.
121
126
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/putByronWalletPassphrase
122
127
  #
@@ -21,6 +21,21 @@ module CardanoWallet
21
21
  def keys
22
22
  Keys.new @opt
23
23
  end
24
+
25
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Addresses
26
+ def addresses
27
+ Addresses.new @opt
28
+ end
29
+ end
30
+
31
+ # API for Addresses
32
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Addresses
33
+ class Addresses < Base
34
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listSharedAddresses
35
+ def list(wid, query = {})
36
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
37
+ self.class.get("/shared-wallets/#{wid}/addresses#{query_formatted}")
38
+ end
24
39
  end
25
40
 
26
41
  # API for Keys
@@ -34,22 +49,29 @@ module CardanoWallet
34
49
  end
35
50
 
36
51
  # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postAccountKeyShared
37
- def create_acc_public_key(wid, index, pass, format)
38
- payload = { passphrase: pass, format: format }
52
+ def create_acc_public_key(wid, index, payload)
53
+ # payload = { passphrase: pass, format: format }
54
+ Utils.verify_param_is_hash!(payload)
39
55
  self.class.post("/shared-wallets/#{wid}/keys/#{index}",
40
56
  body: payload.to_json,
41
57
  headers: { 'Content-Type' => 'application/json' })
42
58
  end
59
+
60
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getAccountKeyShared
61
+ def get_acc_public_key(wid, query = {})
62
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
63
+ self.class.get("/shared-wallets/#{wid}/keys#{query_formatted}")
64
+ end
43
65
  end
44
66
 
45
67
  # API for Wallets
46
68
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Wallets
47
69
  class Wallets < Base
48
70
  # List all wallets
49
- # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listWallets
50
- # def list
51
- # self.class.get('/shared-wallets')
52
- # end
71
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listSharedWallets
72
+ def list
73
+ self.class.get('/shared-wallets')
74
+ end
53
75
 
54
76
  # Get wallet details
55
77
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getSharedWallet
@@ -93,12 +93,19 @@ module CardanoWallet
93
93
  end
94
94
 
95
95
  # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postAccountKey
96
- def create_acc_public_key(wid, index, pass, format)
97
- payload = { passphrase: pass, format: format }
96
+ def create_acc_public_key(wid, index, payload)
97
+ # payload = { passphrase: pass, format: format, purpose: purpose }
98
+ Utils.verify_param_is_hash!(payload)
98
99
  self.class.post("/wallets/#{wid}/keys/#{index}",
99
100
  body: payload.to_json,
100
101
  headers: { 'Content-Type' => 'application/json' })
101
102
  end
103
+
104
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getAccountKey
105
+ def get_acc_public_key(wid, query = {})
106
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
107
+ self.class.get("/wallets/#{wid}/keys#{query_formatted}")
108
+ end
102
109
  end
103
110
 
104
111
  # API for Wallets
@@ -160,6 +167,11 @@ module CardanoWallet
160
167
  self.class.get("/wallets/#{wid}/statistics/utxos")
161
168
  end
162
169
 
170
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getWalletUtxoSnapshot
171
+ def utxo_snapshot(wid)
172
+ self.class.get("/wallets/#{wid}/utxo")
173
+ end
174
+
163
175
  # Update wallet's passphrase
164
176
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/putWalletPassphrase
165
177
  #
@@ -343,6 +355,12 @@ module CardanoWallet
343
355
  self.class.get("/stake-pools#{query}")
344
356
  end
345
357
 
358
+ # List all stake keys
359
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listStakeKeys
360
+ def list_stake_keys(wid)
361
+ self.class.get("/wallets/#{wid}/stake-keys")
362
+ end
363
+
346
364
  # Join stake pool
347
365
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/joinStakePool
348
366
  def join(sp_id, wid, passphrase)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.6'
4
+ VERSION = '0.3.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cardano_wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Stachyra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-13 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty