cardano_wallet 0.3.5 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/lib/cardano_wallet/byron.rb +5 -0
- data/lib/cardano_wallet/shared.rb +50 -4
- data/lib/cardano_wallet/shelley.rb +19 -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: f384a2f90f9d7d8ccf03a093933b5b1f415be587ab3ac32a607e509c3530e7f8
|
4
|
+
data.tar.gz: 21e513675aa00c5a6d26dc34d049ea127b46f75d0d31d695871b2dd0cc9dcf7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc9038c4cfc5358bce078b4f224ae1a5fe446d049f691eb084b80c70d4a3eb14807acc39792e1ed6b93604603ba2cfc8d46640b66c7fd3c84d42653422ffbed
|
7
|
+
data.tar.gz: afc8b07a4e04d33038ffc0f41a24ec525f93a4f98216c394b4279c327e4ee075b2037a978d859fae40405cc26c511cbb7daf95197a7928ef678e68bb5b79e8b5
|
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
|
#
|
@@ -15,16 +15,62 @@ module CardanoWallet
|
|
15
15
|
def wallets
|
16
16
|
Wallets.new @opt
|
17
17
|
end
|
18
|
+
|
19
|
+
# Call API for Shared Keys
|
20
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Keys
|
21
|
+
def keys
|
22
|
+
Keys.new @opt
|
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
|
39
|
+
end
|
40
|
+
|
41
|
+
# API for Keys
|
42
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Keys
|
43
|
+
class Keys < Base
|
44
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getSharedWalletKey
|
45
|
+
# https://localhost:8090/v2/shared-wallets/{walletId}/keys/{role}/{index}?hash=false
|
46
|
+
def get_public_key(wid, role, index, hash = {})
|
47
|
+
hash_query = hash.empty? ? '' : Utils.to_query(hash)
|
48
|
+
self.class.get("/shared-wallets/#{wid}/keys/#{role}/#{index}#{hash_query}")
|
49
|
+
end
|
50
|
+
|
51
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postAccountKeyShared
|
52
|
+
def create_acc_public_key(wid, index, pass, format)
|
53
|
+
payload = { passphrase: pass, format: format }
|
54
|
+
self.class.post("/shared-wallets/#{wid}/keys/#{index}",
|
55
|
+
body: payload.to_json,
|
56
|
+
headers: { 'Content-Type' => 'application/json' })
|
57
|
+
end
|
58
|
+
|
59
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getAccountKeyShared
|
60
|
+
def get_acc_public_key(wid, query = {})
|
61
|
+
query_formatted = query.empty? ? '' : Utils.to_query(query)
|
62
|
+
self.class.get("/shared-wallets/#{wid}/keys#{query_formatted}")
|
63
|
+
end
|
18
64
|
end
|
19
65
|
|
20
66
|
# API for Wallets
|
21
67
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Wallets
|
22
68
|
class Wallets < Base
|
23
69
|
# List all wallets
|
24
|
-
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/
|
25
|
-
|
26
|
-
|
27
|
-
|
70
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listSharedWallets
|
71
|
+
def list
|
72
|
+
self.class.get('/shared-wallets')
|
73
|
+
end
|
28
74
|
|
29
75
|
# Get wallet details
|
30
76
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getSharedWallet
|
@@ -93,12 +93,18 @@ 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,
|
97
|
-
payload = { passphrase: pass,
|
96
|
+
def create_acc_public_key(wid, index, pass, format)
|
97
|
+
payload = { passphrase: pass, format: format }
|
98
98
|
self.class.post("/wallets/#{wid}/keys/#{index}",
|
99
99
|
body: payload.to_json,
|
100
100
|
headers: { 'Content-Type' => 'application/json' })
|
101
101
|
end
|
102
|
+
|
103
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getAccountKey
|
104
|
+
def get_acc_public_key(wid, query = {})
|
105
|
+
query_formatted = query.empty? ? '' : Utils.to_query(query)
|
106
|
+
self.class.get("/wallets/#{wid}/keys#{query_formatted}")
|
107
|
+
end
|
102
108
|
end
|
103
109
|
|
104
110
|
# API for Wallets
|
@@ -160,6 +166,11 @@ module CardanoWallet
|
|
160
166
|
self.class.get("/wallets/#{wid}/statistics/utxos")
|
161
167
|
end
|
162
168
|
|
169
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getWalletUtxoSnapshot
|
170
|
+
def utxo_snapshot(wid)
|
171
|
+
self.class.get("/wallets/#{wid}/utxo")
|
172
|
+
end
|
173
|
+
|
163
174
|
# Update wallet's passphrase
|
164
175
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/putWalletPassphrase
|
165
176
|
#
|
@@ -343,6 +354,12 @@ module CardanoWallet
|
|
343
354
|
self.class.get("/stake-pools#{query}")
|
344
355
|
end
|
345
356
|
|
357
|
+
# List all stake keys
|
358
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listStakeKeys
|
359
|
+
def list_stake_keys(wid)
|
360
|
+
self.class.get("/wallets/#{wid}/stake-keys")
|
361
|
+
end
|
362
|
+
|
346
363
|
# Join stake pool
|
347
364
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/joinStakePool
|
348
365
|
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.10
|
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-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|