cardano_wallet 0.3.6 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/lib/cardano_wallet/byron.rb +5 -0
- data/lib/cardano_wallet/shared.rb +28 -6
- data/lib/cardano_wallet/shelley.rb +20 -2
- data/lib/cardano_wallet/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c14cc02d6ed07e1806787d053ba1757012cf99210aba0aa4d24945319fea0eb
|
4
|
+
data.tar.gz: f6f4cf5ba6b44c8cce833d5718f8bb5bde56ba4067c426f4b16f7881d06f2a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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>
|
data/lib/cardano_wallet/byron.rb
CHANGED
@@ -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,
|
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/
|
50
|
-
|
51
|
-
|
52
|
-
|
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,
|
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)
|
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.
|
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-
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|