cardano_wallet 0.3.16 → 0.3.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fa0c383ca96ba2ca8b2293d2754578a41aabc2db26617ca51f0519d662b0820
4
- data.tar.gz: 36a2ca1a5a76837978ae826e7d285ac53ab24eccf13678489d9f5383e0695592
3
+ metadata.gz: 1f3553eac627012a6c1503cc9a95fe76c17685c4437f0cf2f2ca899c8f16e760
4
+ data.tar.gz: adf34dad29c5b8443afd31d88e7b7f1574958826730b1d0beaefa8609f9964da
5
5
  SHA512:
6
- metadata.gz: 92abce3f9b08f24e9be3138236eb346ab2c992b61b8c4182bc4dbeae02fa572708de671b56d3dbef1ac1bb589bf4ee878369967da05e8c6d8b020de125668a0f
7
- data.tar.gz: 9fc6f2d60b340f6cb9161a34d33b2b4b97c49cac0a4ba670c8b5d69dc2e901abed986acdda5f1d5de6e459755b47c2bf61a17161b744271311b9f9d8c530478a
6
+ metadata.gz: 46594f10f0e1507601213fa770c92ee3bf7595e0ddc509d6d4a5733e6fd5d22a5a903cb5f613cf5d7bc3508518effc9440c22599331659d0eb4197f1f9b70a05
7
+ data.tar.gz: a0d46087763b83c37cffa91b88623faa3981b00eb8b249ebdc05ec3904f54299bf35ecc695a0bc5c46ad37fc05a53c9c3db7385360a168ee89b9ba91335dd66d
data/Rakefile CHANGED
@@ -12,9 +12,7 @@ task default: :spec
12
12
  def wget(url, file = nil)
13
13
  file ||= File.basename(url)
14
14
  resp = HTTParty.get(url)
15
- File.open(file, 'wb') do |f|
16
- f.write(resp.body)
17
- end
15
+ File.binwrite(file, resp.body)
18
16
  puts "#{url} -> #{resp.code}"
19
17
  end
20
18
 
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.metadata['homepage_uri'] = spec.homepage
20
20
  spec.metadata['source_code_uri'] = spec.homepage
21
21
  spec.metadata['changelog_uri'] = spec.homepage
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
23
 
23
24
  # Specify which files should be added to the gem when it is released.
24
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -233,7 +233,7 @@ module CardanoWallet
233
233
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signByronTransaction
234
234
  # @param wid [String] source wallet id
235
235
  # @param passphrase [String] wallet's passphrase
236
- # @param passphrase [String] CBOR transaction data
236
+ # @param transaction [String] CBOR transaction data
237
237
  def sign(wid, passphrase, transaction)
238
238
  payload = {
239
239
  'passphrase' => passphrase,
@@ -245,6 +245,17 @@ module CardanoWallet
245
245
  headers: { 'Content-Type' => 'application/json' })
246
246
  end
247
247
 
248
+ # Submit transaction
249
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/submitByronTransaction
250
+ # @param wid [String] source wallet id
251
+ # @param transaction [String] CBOR transaction data
252
+ def submit(wid, transaction)
253
+ payload = { 'transaction' => transaction }
254
+ self.class.post("/byron-wallets/#{wid}/transactions-submit",
255
+ body: payload.to_json,
256
+ headers: { 'Content-Type' => 'application/json' })
257
+ end
258
+
248
259
  # Get tx by id
249
260
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronTransaction
250
261
  def get(wid, tx_id)
@@ -122,6 +122,21 @@ module CardanoWallet
122
122
  query_formatted = query.empty? ? '' : Utils.to_query(query)
123
123
  self.class.get("/wallets/#{wid}/keys#{query_formatted}")
124
124
  end
125
+
126
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getPolicyKey
127
+ def get_policy_key(wid, query = {})
128
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
129
+ self.class.get("/wallets/#{wid}/policy-key#{query_formatted}")
130
+ end
131
+
132
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postPolicyKey
133
+ def create_policy_key(wid, passphrase, query = {})
134
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
135
+ payload = { passphrase: passphrase }
136
+ self.class.post("/wallets/#{wid}/policy-key#{query_formatted}",
137
+ body: payload.to_json,
138
+ headers: { 'Content-Type' => 'application/json' })
139
+ end
125
140
  end
126
141
 
127
142
  # API for Wallets
@@ -269,6 +284,18 @@ module CardanoWallet
269
284
  headers: { 'Content-Type' => 'application/json' })
270
285
  end
271
286
 
287
+ # Decode transaction
288
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/decodeTransaction
289
+ # @param wid [String] source wallet id
290
+ # @param transaction [String] CBOR base64|base16 encoded transaction
291
+ def decode(wid, transaction)
292
+ payload = {}
293
+ payload[:transaction] = transaction
294
+ self.class.post("/wallets/#{wid}/transactions-decode",
295
+ body: payload.to_json,
296
+ headers: { 'Content-Type' => 'application/json' })
297
+ end
298
+
272
299
  # Construct transaction
273
300
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction
274
301
  # @param wid [String] source wallet id
@@ -289,7 +316,7 @@ module CardanoWallet
289
316
  payload[:payments] = payments if payments
290
317
  payload[:withdrawal] = withdrawal if withdrawal
291
318
  payload[:metadata] = metadata if metadata
292
- payload[:mint] = mint if mint
319
+ payload[:mint_burn] = mint if mint
293
320
  payload[:delegations] = delegations if delegations
294
321
  payload[:validity_interval] = validity_interval if validity_interval
295
322
 
@@ -302,7 +329,7 @@ module CardanoWallet
302
329
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signTransaction
303
330
  # @param wid [String] source wallet id
304
331
  # @param passphrase [String] wallet's passphrase
305
- # @param passphrase [String] CBOR transaction data
332
+ # @param transaction [String] CBOR transaction data
306
333
  def sign(wid, passphrase, transaction)
307
334
  payload = {
308
335
  'passphrase' => passphrase,
@@ -314,6 +341,17 @@ module CardanoWallet
314
341
  headers: { 'Content-Type' => 'application/json' })
315
342
  end
316
343
 
344
+ # Submit transaction
345
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/submitTransaction
346
+ # @param wid [String] source wallet id
347
+ # @param transaction [String] CBOR transaction data
348
+ def submit(wid, transaction)
349
+ payload = { 'transaction' => transaction }
350
+ self.class.post("/wallets/#{wid}/transactions-submit",
351
+ body: payload.to_json,
352
+ headers: { 'Content-Type' => 'application/json' })
353
+ end
354
+
317
355
  # Get tx by id
318
356
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
319
357
  def get(wid, tx_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.16'
4
+ VERSION = '0.3.19'
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.16
4
+ version: 0.3.19
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-10-15 00:00:00.000000000 Z
11
+ date: 2022-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -149,6 +149,7 @@ metadata:
149
149
  homepage_uri: https://github.com/piotr-iohk/cardano-wallet-rb
150
150
  source_code_uri: https://github.com/piotr-iohk/cardano-wallet-rb
151
151
  changelog_uri: https://github.com/piotr-iohk/cardano-wallet-rb
152
+ rubygems_mfa_required: 'true'
152
153
  post_install_message:
153
154
  rdoc_options: []
154
155
  require_paths:
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
165
  - !ruby/object:Gem::Version
165
166
  version: '0'
166
167
  requirements: []
167
- rubygems_version: 3.2.22
168
+ rubygems_version: 3.2.32
168
169
  signing_key:
169
170
  specification_version: 4
170
171
  summary: Ruby wrapper over cardano-wallet.