peatio-decredcoin 3.0.0 → 3.0.1
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 +4 -4
- data/lib/peatio/decredcoin/version.rb +1 -1
- data/lib/peatio/decredcoin/wallet.rb +14 -16
- 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: ba6527e3a8120dd3f82a8ae75e287680e0c1413af2eccee5492ecdc1dc9b29e8
|
|
4
|
+
data.tar.gz: 5d554617a8ebfff649c71ff516b838bc3858e2a09bbfe9f249fccdf8b8db6eab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67fd7d1622e46f75c0c694cc945b8394d36da57fcb23f9a41e1eae0a62741fcc79c9a6f6438daba8f8879748ec94de0aa666f858f2af2f36e7ae38c330c7c356
|
|
7
|
+
data.tar.gz: cec8773eae6c3022fd45679771a19c4ad0ecd4bf28a41062ccba891cb57ef9999b2e3b23f5a15da302c52c3155a325cc571ef9b82c583e8b393d776fbdc1493e
|
|
@@ -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
|
-
|
|
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.
|
|
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
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|