cardano_wallet 0.3.4 → 0.3.9
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 +11 -4
- data/lib/cardano_wallet/shared.rb +50 -4
- data/lib/cardano_wallet/shelley.rb +19 -6
- 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: 1ca7324e8297c5dc1450d6f80d152ef4e8c5f955a26b293a6fd25bdff5f573c9
|
4
|
+
data.tar.gz: 55143e350cb6fe9a4c0fc6b6041901cf175a37d035a8625accca1f69b4728eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17823106144667576a2cd3a43a34020cd0ce6f9d9182f93836c82a6987d6e8ec4d74ccf7c5e0fc99566902a5a39ab096a339d575f59af3a5be4ee60472abc938
|
7
|
+
data.tar.gz: e43e2cb40b72f39f477dfbb2aa3b364d326ee5222072ce78bfa28b4b219b44f26eca9e2433eae870bfe558e80b6a86ff1e883cdef0dffd62666ed29370f1540b
|
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
|
#
|
@@ -276,10 +281,12 @@ module CardanoWallet
|
|
276
281
|
# Byron migrations
|
277
282
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Byron-Migrations
|
278
283
|
class Migrations < Base
|
279
|
-
#
|
280
|
-
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/
|
281
|
-
def
|
282
|
-
self.class.
|
284
|
+
# Get migration plan
|
285
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/createByronWalletMigrationPlan
|
286
|
+
def plan(wid, addresses)
|
287
|
+
self.class.post("/byron-wallets/#{wid}/migrations/plan",
|
288
|
+
body: { addresses: addresses }.to_json,
|
289
|
+
headers: { 'Content-Type' => 'application/json' })
|
283
290
|
end
|
284
291
|
|
285
292
|
# Migrate all funds from Byron wallet.
|
@@ -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
|
#
|
@@ -369,10 +380,12 @@ module CardanoWallet
|
|
369
380
|
# Shelley migrations
|
370
381
|
# @see https://input-output-hk.github.io/cardano-wallet/api/#tag/Migrations
|
371
382
|
class Migrations < Base
|
372
|
-
#
|
373
|
-
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/
|
374
|
-
def
|
375
|
-
self.class.
|
383
|
+
# Get migration plan
|
384
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/createShelleyWalletMigrationPlan
|
385
|
+
def plan(wid, addresses)
|
386
|
+
self.class.post("/wallets/#{wid}/migrations/plan",
|
387
|
+
body: { addresses: addresses }.to_json,
|
388
|
+
headers: { 'Content-Type' => 'application/json' })
|
376
389
|
end
|
377
390
|
|
378
391
|
# Migrate all funds from Shelley wallet.
|
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.9
|
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-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|