peatio-bitgo 2.6.6 → 2.6.7
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/Gemfile.lock +6 -6
- data/lib/peatio/bitgo/version.rb +1 -1
- data/lib/peatio/bitgo/wallet.rb +14 -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: '062810d1807c29ab63130d8bb190de25c2cab3f482829e0abdff61cae4187422'
|
|
4
|
+
data.tar.gz: cb04bdf39f57405c46fb7903db410a55eb269bac1f19300422812c88ea052dae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b40f51251f29accdcee17938e1dda4c74ccb362dd85664faf979366164f629d80b659de3bd01d95763b3f6629591a95d6fafc97e380ac1eff5f9b080e5b4560b
|
|
7
|
+
data.tar.gz: e2f7372b54ba702d1a845c80e4e3f85daa580c177bcfdcb65bfbbde27f1eeabafa1b8d321b63e91fac9b71c76311a07912d0af1db3be439ad75dc8f06a619154
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
peatio-bitgo (2.6.
|
|
4
|
+
peatio-bitgo (2.6.7)
|
|
5
5
|
activesupport (~> 5.2.3)
|
|
6
6
|
better-faraday (~> 1.0.5)
|
|
7
7
|
faraday (~> 0.17)
|
|
@@ -12,9 +12,9 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
activemodel (5.2.
|
|
16
|
-
activesupport (= 5.2.
|
|
17
|
-
activesupport (5.2.
|
|
15
|
+
activemodel (5.2.4.4)
|
|
16
|
+
activesupport (= 5.2.4.4)
|
|
17
|
+
activesupport (5.2.4.4)
|
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
19
19
|
i18n (>= 0.7, < 2)
|
|
20
20
|
minitest (~> 5.1)
|
|
@@ -38,7 +38,7 @@ GEM
|
|
|
38
38
|
cookiejar (0.3.3)
|
|
39
39
|
crack (0.4.3)
|
|
40
40
|
safe_yaml (~> 1.0.0)
|
|
41
|
-
daemons (1.
|
|
41
|
+
daemons (1.4.0)
|
|
42
42
|
diff-lcs (1.4.4)
|
|
43
43
|
em-http-request (1.1.7)
|
|
44
44
|
addressable (>= 2.3.4)
|
|
@@ -73,7 +73,7 @@ GEM
|
|
|
73
73
|
http_parser.rb (0.6.0)
|
|
74
74
|
i18n (1.8.10)
|
|
75
75
|
concurrent-ruby (~> 1.0)
|
|
76
|
-
jwt (2.2.
|
|
76
|
+
jwt (2.2.3)
|
|
77
77
|
memoist (0.16.2)
|
|
78
78
|
method_source (1.0.0)
|
|
79
79
|
minitest (5.14.4)
|
data/lib/peatio/bitgo/version.rb
CHANGED
data/lib/peatio/bitgo/wallet.rb
CHANGED
|
@@ -86,7 +86,15 @@ module Peatio
|
|
|
86
86
|
|
|
87
87
|
def create_eth_transaction(transaction, options = {})
|
|
88
88
|
amount = convert_to_base_unit(transaction.amount)
|
|
89
|
-
hop =
|
|
89
|
+
hop = options.slice(:erc20_contract_address).present? ? false : true
|
|
90
|
+
|
|
91
|
+
fee_estimate = fee_estimate(amount.to_s, hop)
|
|
92
|
+
|
|
93
|
+
if transaction.options.present?
|
|
94
|
+
options[:gas_price] = transaction.options[:gas_price]
|
|
95
|
+
else
|
|
96
|
+
options[:gas_price] = fee_estimate['minGasPrice'].to_i
|
|
97
|
+
end
|
|
90
98
|
|
|
91
99
|
txid = client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/sendcoins", {
|
|
92
100
|
address: transaction.to_address.to_s,
|
|
@@ -98,9 +106,14 @@ module Peatio
|
|
|
98
106
|
}.compact).fetch('txid')
|
|
99
107
|
|
|
100
108
|
transaction.hash = normalize_txid(txid)
|
|
109
|
+
transaction.options = options
|
|
101
110
|
transaction
|
|
102
111
|
end
|
|
103
112
|
|
|
113
|
+
def fee_estimate(amount, hop)
|
|
114
|
+
client.rest_api(:get, "#{erc20_currency_id}/tx/fee", {amount: amount, hop: hop})
|
|
115
|
+
end
|
|
116
|
+
|
|
104
117
|
def load_balance!
|
|
105
118
|
if @currency.fetch(:options).slice(:erc20_contract_address).present?
|
|
106
119
|
load_erc20_balance!
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: peatio-bitgo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.6.
|
|
4
|
+
version: 2.6.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nadia Ch., Maksym N.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|