cardano_wallet 0.2.3 → 0.2.4

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: 74c9782cd3632fcc7dcfa508223f69a9a027870866bdb5d396c6148882e52fd6
4
- data.tar.gz: caac73d294e60c1cf420494cb8642e920953671fd2c9934f8f94d8701a5f4b32
3
+ metadata.gz: 138963a69580ac035ec96fe4d0aa0b312ad9896c202e84079a2bb017fba537d2
4
+ data.tar.gz: 3e5131b4d9fac94536f4002827d233d0054d2e648bb1e8846e3ed751a0432e3a
5
5
  SHA512:
6
- metadata.gz: 0c97ede17011cbb192b1de47ee7048dbe3dd56b8fdbb98c304549da2de0cd54838783dba1987b7ff7bd5aba1f6800455b62449283e42e68eb05beaeed7abe63f
7
- data.tar.gz: 04caba35632d0e15825414e6bf1680b50673a9c1e7e9c65a1bad4ed0e82a03af3ca17aa64fce28a7ddadaabd3a54716b9fb5cc8ca590be0b3cff17cb09cf1e80
6
+ metadata.gz: 8ab66b2b2d66b6c80d2c0972ca2c3605c7d0bbafb3bff4af9fce72dba96adebc471d01410a7fad3900999d5cb6138c3e2d1078527e0d3fc73d9cabb370739489
7
+ data.tar.gz: 12d5479650d0e9b5af8c766709ae6ff9e3ade893d58dbfe5e211286d3346ec4f7ec156322b5d513fce84b93c826893f905bfc45f915786ff78b51960bedece64
@@ -30,6 +30,7 @@ module CardanoWallet
30
30
  def settings
31
31
  Settings.new @opt
32
32
  end
33
+
33
34
  end
34
35
 
35
36
  # API for Network
@@ -87,6 +88,22 @@ module CardanoWallet
87
88
  super
88
89
  end
89
90
 
91
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/signMetadata
92
+ def sign_metadata(wid, role, index, pass, metadata)
93
+ payload = { passphrase: pass }
94
+ payload[:metadata] = metadata if metadata
95
+
96
+ self.class.post("/wallets/#{wid}/signatures/#{role}/#{index}",
97
+ :body => payload.to_json,
98
+ :headers => { 'Content-Type' => 'application/json',
99
+ 'Accept' => 'application/octet-stream'} )
100
+ end
101
+
102
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getWalletKey
103
+ def get_public_key(wid, role, index)
104
+ self.class.get("/wallets/#{wid}/keys/#{role}/#{index}")
105
+ end
106
+
90
107
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/inspectAddress
91
108
  def addresses(address_id)
92
109
  self.class.get("/addresses/#{address_id}")
@@ -48,6 +48,35 @@ module CardanoWallet
48
48
  Migrations.new @opt
49
49
  end
50
50
 
51
+ # API for Keys
52
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#tag/Keys
53
+ def keys
54
+ Keys.new @opt
55
+ end
56
+
57
+ end
58
+
59
+ class Keys < Base
60
+ def initialize opt
61
+ super
62
+ end
63
+
64
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/signMetadata
65
+ def sign_metadata(wid, role, index, pass, metadata)
66
+ payload = { passphrase: pass }
67
+ payload[:metadata] = metadata if metadata
68
+
69
+ self.class.post("/wallets/#{wid}/signatures/#{role}/#{index}",
70
+ :body => payload.to_json,
71
+ :headers => { 'Content-Type' => 'application/json',
72
+ 'Accept' => 'application/octet-stream'} )
73
+ end
74
+
75
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getWalletKey
76
+ def get_public_key(wid, role, index)
77
+ self.class.get("/wallets/#{wid}/keys/#{role}/#{index}")
78
+ end
79
+
51
80
  end
52
81
 
53
82
  # API for Wallets
@@ -1,3 +1,3 @@
1
1
  module CardanoWallet
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Stachyra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-19 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty