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 +4 -4
- data/lib/cardano_wallet/misc.rb +17 -0
- data/lib/cardano_wallet/shelley.rb +29 -0
- 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: 138963a69580ac035ec96fe4d0aa0b312ad9896c202e84079a2bb017fba537d2
|
4
|
+
data.tar.gz: 3e5131b4d9fac94536f4002827d233d0054d2e648bb1e8846e3ed751a0432e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ab66b2b2d66b6c80d2c0972ca2c3605c7d0bbafb3bff4af9fce72dba96adebc471d01410a7fad3900999d5cb6138c3e2d1078527e0d3fc73d9cabb370739489
|
7
|
+
data.tar.gz: 12d5479650d0e9b5af8c766709ae6ff9e3ade893d58dbfe5e211286d3346ec4f7ec156322b5d513fce84b93c826893f905bfc45f915786ff78b51960bedece64
|
data/lib/cardano_wallet/misc.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|