cardano_wallet 0.3.0 → 0.3.1

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: d0de7182a62723fefbe32712a08ac13765fe4507ac90969d3b752aff67fb05af
4
- data.tar.gz: e6346e28024ce715b14ab9964634f4dc5bf80f7d63526bae0a6c4bc4d2bce22f
3
+ metadata.gz: f416f0ff4fd389ce9af664e9c128f0765cda62c346f6b2f3b5237a884e43a253
4
+ data.tar.gz: 5769fb34859b6c2ddc7376a718ba5c0fc7962810cc1d3fc6012a82219d979302
5
5
  SHA512:
6
- metadata.gz: d2e7311a7a4ef549aae1f9fb571f1ccc7e84800b9ffe10b80f08b23586a3e2cadd73aefb3215ad1bef28e5f8f09198323fafb01a4d0f3053770dd27d087f1281
7
- data.tar.gz: 3e4df4399289e3772061e4e8e68cae38a58308cbfb837b940af4736e36b1052884791cc641811a3b987307f75075e8df306bd0778683e83acf1479edd760a381
6
+ metadata.gz: 8b3492bd2f7f215a3ef7008ae997189eab233ab821764f93a1bae69f3bf859258c519dd808e433ec2edcc6f9ba183e59dc28e3439d974dc35dec498f106becf7
7
+ data.tar.gz: 877550274108bc8c06203b9f488493c930d57b45c71ce7601f0116d129826f5638801dc46355b123ec2bf784977129e9a73fdfbc430e1d52f7bd13c28dbe39f8
@@ -205,8 +205,14 @@ module CardanoWallet
205
205
  #
206
206
  # @example
207
207
  # random(wid, [{addr1: 1000000}, {addr2: 1000000}])
208
+ # random(wid, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ])
208
209
  def random(wid, payments)
209
- payments_formatted = Utils.format_payments(payments)
210
+ Utils.verify_param_is_array!(payments)
211
+ if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
212
+ payments_formatted = payments
213
+ else
214
+ payments_formatted = Utils.format_payments(payments)
215
+ end
210
216
  self.class.post("/byron-wallets/#{wid}/coin-selections/random",
211
217
  :body => {:payments => payments_formatted}.to_json,
212
218
  :headers => { 'Content-Type' => 'application/json' })
@@ -247,6 +253,7 @@ module CardanoWallet
247
253
  # create(wid, passphrase, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ])
248
254
 
249
255
  def create(wid, passphrase, payments)
256
+ Utils.verify_param_is_array!(payments)
250
257
  if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
251
258
  payments_formatted = payments
252
259
  else
@@ -266,6 +273,7 @@ module CardanoWallet
266
273
  # payment_fees(wid, [{addr1: 1000000}, {addr2: 1000000}])
267
274
  # payment_fees(wid, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ])
268
275
  def payment_fees(wid, payments)
276
+ Utils.verify_param_is_array!(payments)
269
277
  if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
270
278
  payments_formatted = payments
271
279
  else
@@ -220,8 +220,14 @@ module CardanoWallet
220
220
  #
221
221
  # @example
222
222
  # random(wid, [{addr1: 1000000}, {addr2: 1000000}])
223
+ # random(wid, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ])
223
224
  def random(wid, payments)
224
- payments_formatted = Utils.format_payments(payments)
225
+ Utils.verify_param_is_array!(payments)
226
+ if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
227
+ payments_formatted = payments
228
+ else
229
+ payments_formatted = Utils.format_payments(payments)
230
+ end
225
231
  self.class.post("/wallets/#{wid}/coin-selections/random",
226
232
  :body => {:payments => payments_formatted}.to_json,
227
233
  :headers => { 'Content-Type' => 'application/json' })
@@ -277,6 +283,7 @@ module CardanoWallet
277
283
  # create(wid, passphrase, [{addr1: 1000000}, {addr2: 1000000}], 'self', {"1": "abc"}, ttl = 10)
278
284
  # create(wid, passphrase, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ], 'self', {"1": "abc"}, ttl = 10)
279
285
  def create(wid, passphrase, payments, withdrawal = nil, metadata = nil, ttl = nil)
286
+ Utils.verify_param_is_array!(payments)
280
287
  if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
281
288
  payments_formatted = payments
282
289
  else
@@ -301,6 +308,7 @@ module CardanoWallet
301
308
  # payment_fees(wid, [{addr1: 1000000}, {addr2: 1000000}], {"1": "abc"}, ttl = 10)
302
309
  # payment_fees(wid, [{ "address": "addr1..", "amount": { "quantity": 42000000, "unit": "lovelace" }, "assets": [{"policy_id": "pid", "asset_name": "name", "quantity": 0 } ] } ], {"1": "abc"}, ttl = 10)
303
310
  def payment_fees(wid, payments, withdrawal = nil, metadata = nil, ttl = nil)
311
+ Utils.verify_param_is_array!(payments)
304
312
  if payments.any?{|p| p.has_key?("address".to_sym) || p.has_key?("address")}
305
313
  payments_formatted = payments
306
314
  else
@@ -1,3 +1,3 @@
1
1
  module CardanoWallet
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
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.3.0
4
+ version: 0.3.1
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-01-29 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty