cardano_wallet 0.3.3 → 0.3.8

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: 3e96ef68a97833180203b09137217a2e3667800f2eb13b2131505f93879a3c5e
4
- data.tar.gz: 2312bc7afae1647800d0e25e422cf811ee3c94d2d4d97ce45e9662f6dd4d8ccc
3
+ metadata.gz: 3ff97345f66a326cdbb4cfa28e0458ea55a0bb5eca469c2f86ef939837618c03
4
+ data.tar.gz: a8a4515006fa955c86f072ce4b3233023cff3ffdf049958858a24b7dc7099842
5
5
  SHA512:
6
- metadata.gz: 60059be2b38590b8819879ae4c7433478289048db9d4b9a258520c74d8bb0d62e7b05693a1575d6c4bfed18e5b8385425960d2ee0f8bd7bdd3526d8b541c74da
7
- data.tar.gz: 22ae9e0ed677b5591c5e6ff1c9a27fc406eb0c7d7df18d73924bb8081d51614c2e9ee4b50f91379de6cffc4a4baf4e8e11b47352235488ea1c278ac70977dcaf
6
+ metadata.gz: 5a661209422fe8e47bb7bc964107fb7726fb08b350db98e636eaeb224ce09447b7ea23b2663152bd27094a48e306f93c826b15b2d912c6111491f82bb22677aa
7
+ data.tar.gz: 8070466c5997132e9c878b302065a3796415494c36b0b7f579f8da7d64d553d4d141a0be1d276d77f5cca3da0ebdfcaa949b8be75f07d6a0c8f289d591f55e73
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>
@@ -276,10 +276,12 @@ module CardanoWallet
276
276
  # Byron migrations
277
277
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Byron-Migrations
278
278
  class Migrations < Base
279
- # Calculate migration cost
280
- # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronWalletMigrationInfo
281
- def cost(wid)
282
- self.class.get("/byron-wallets/#{wid}/migrations")
279
+ # Get migration plan
280
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/createByronWalletMigrationPlan
281
+ def plan(wid, addresses)
282
+ self.class.post("/byron-wallets/#{wid}/migrations/plan",
283
+ body: { addresses: addresses }.to_json,
284
+ headers: { 'Content-Type' => 'application/json' })
283
285
  end
284
286
 
285
287
  # 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/listWallets
25
- # def list
26
- # self.class.get('/shared-wallets')
27
- # end
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
@@ -60,7 +106,7 @@ module CardanoWallet
60
106
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/patchSharedWalletInPayment
61
107
  def update_payment_script(wid, cosigner, acc_pub_key)
62
108
  self.class.patch("/shared-wallets/#{wid}/payment-script-template",
63
- body: { cosigner: cosigner, account_public_key: acc_pub_key }.to_json,
109
+ body: { cosigner => acc_pub_key }.to_json,
64
110
  headers: { 'Content-Type' => 'application/json' })
65
111
  end
66
112
 
@@ -68,7 +114,7 @@ module CardanoWallet
68
114
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/patchSharedWalletInDelegation
69
115
  def update_delegation_script(wid, cosigner, acc_pub_key)
70
116
  self.class.patch("/shared-wallets/#{wid}/delegation-script-template",
71
- body: { cosigner: cosigner, account_public_key: acc_pub_key }.to_json,
117
+ body: { cosigner => acc_pub_key }.to_json,
72
118
  headers: { 'Content-Type' => 'application/json' })
73
119
  end
74
120
  end
@@ -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, extended)
97
- payload = { passphrase: pass, extended: extended }
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
@@ -369,10 +375,12 @@ module CardanoWallet
369
375
  # Shelley migrations
370
376
  # @see https://input-output-hk.github.io/cardano-wallet/api/#tag/Migrations
371
377
  class Migrations < Base
372
- # Calculate migration cost
373
- # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getShelleyWalletMigrationInfo
374
- def cost(wid)
375
- self.class.get("/wallets/#{wid}/migrations")
378
+ # Get migration plan
379
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/createShelleyWalletMigrationPlan
380
+ def plan(wid, addresses)
381
+ self.class.post("/wallets/#{wid}/migrations/plan",
382
+ body: { addresses: addresses }.to_json,
383
+ headers: { 'Content-Type' => 'application/json' })
376
384
  end
377
385
 
378
386
  # Migrate all funds from Shelley wallet.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.8'
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.3
4
+ version: 0.3.8
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-04-19 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty