peatio-decredcoin 3.0.0 → 3.0.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: a29cfc88f36b57a5541a40f2870e49ce4dfbf941ab162e143b878db47d6fdf2e
4
- data.tar.gz: 703d9426bb8a02ed9f163421cf6dd7760329a972533765122d7e41eabaec3087
3
+ metadata.gz: ba6527e3a8120dd3f82a8ae75e287680e0c1413af2eccee5492ecdc1dc9b29e8
4
+ data.tar.gz: 5d554617a8ebfff649c71ff516b838bc3858e2a09bbfe9f249fccdf8b8db6eab
5
5
  SHA512:
6
- metadata.gz: aa8874c7a3afc6bfb0ed5dbae2b282470685df738a2e2d2e2258dd47966341a0da5e718cadaea6d4975d8e5b233f5e1532ab4c05a6de9d0304db8a027ef89d57
7
- data.tar.gz: 7e763b8ffd44599f93fc1cc0a85035adc65d9801e3b5b4b8bf56c5984fc158d0be38eed564db3253a084711c4418a40ed26313d8dfa8971e69638ca168a6279b
6
+ metadata.gz: 67fd7d1622e46f75c0c694cc945b8394d36da57fcb23f9a41e1eae0a62741fcc79c9a6f6438daba8f8879748ec94de0aa666f858f2af2f36e7ae38c330c7c356
7
+ data.tar.gz: cec8773eae6c3022fd45679771a19c4ad0ecd4bf28a41062ccba891cb57ef9999b2e3b23f5a15da302c52c3155a325cc571ef9b82c583e8b393d776fbdc1493e
@@ -1,5 +1,5 @@
1
1
  module Peatio
2
2
  module Decredcoin
3
- VERSION = "3.0.0".freeze
3
+ VERSION = "3.0.1".freeze
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ module Peatio
18
18
 
19
19
  @wallet = @settings.fetch(:wallet) do
20
20
  raise Peatio::Wallet::MissingSettingError, :wallet
21
- end.slice(:uri, :address)
21
+ end.slice(:uri, :address, :passphrase)
22
22
 
23
23
  @currency = @settings.fetch(:currency) do
24
24
  raise Peatio::Wallet::MissingSettingError, :currency
@@ -31,22 +31,9 @@ module Peatio
31
31
  raise Peatio::Wallet::ClientError, e
32
32
  end
33
33
 
34
-
35
-
36
- def unlock_wallet!(passphrase, timeout = 15)
37
- # unlock wallet for 10 seconds
38
- client.json_rpc(:walletpassphrase,
39
- [
40
- passphrase,
41
- timeout
42
- ])
43
- rescue Decredcoin::Client::Error => e
44
- raise Peatio::Wallet::ClientError, e
45
- end
46
-
47
-
34
+ # create a transaction
48
35
  def create_transaction!(transaction, options = {})
49
- # create a transaction
36
+ unlock_wallet!(options[:timeout])
50
37
  txid = client.json_rpc(:sendtoaddress,
51
38
  [
52
39
  transaction.to_address,
@@ -71,6 +58,17 @@ module Peatio
71
58
 
72
59
  private
73
60
 
61
+ # unlock wallet for 15 seconds
62
+ def unlock_wallet!(timeout = 15)
63
+ client.json_rpc(:walletpassphrase,
64
+ [
65
+ @wallet.fetch(:passphrase),
66
+ timeout
67
+ ])
68
+ rescue Decredcoin::Client::Error => e
69
+ raise Peatio::Wallet::ClientError, e
70
+ end
71
+
74
72
  def client
75
73
  uri = @wallet.fetch(:uri) { raise Peatio::Wallet::MissingSettingError, :uri }
76
74
  @client ||= Client.new(uri)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peatio-decredcoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anuj Dhiman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-26 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport