peatio-bitgo 2.6.6 → 2.6.7

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: 71849263a007093ed7c9c53d013db6491856d5ea004017d060bec892c4a271fa
4
- data.tar.gz: 10ee3a2cd730999d82bf904c24175e7d2a14a9fa120f12840131f705dda39a6a
3
+ metadata.gz: '062810d1807c29ab63130d8bb190de25c2cab3f482829e0abdff61cae4187422'
4
+ data.tar.gz: cb04bdf39f57405c46fb7903db410a55eb269bac1f19300422812c88ea052dae
5
5
  SHA512:
6
- metadata.gz: afb277f1e26cf4f8de413545c9c433dc6225f5f22ea87190d268aa1b109fb0e1bdc477c2fbc3acca75dee38f1ede75cd6f995d984c4006a960dedab0e22b5a2a
7
- data.tar.gz: 4f2b8fc5fe38426fbe2f6c2ec214bad40bd8430302b095758529f9c07ac6be0cbd102509a119874a3eae529bae35e145e60025216eb46cbd7c7827ec8a75dc09
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.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.5)
16
- activesupport (= 5.2.5)
17
- activesupport (5.2.5)
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.3.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.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)
@@ -1,5 +1,5 @@
1
1
  module Peatio
2
2
  module Bitgo
3
- VERSION = "2.6.6".freeze
3
+ VERSION = "2.6.7".freeze
4
4
  end
5
5
  end
@@ -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 = true unless options.slice(:erc20_contract_address).present?
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.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-04-15 00:00:00.000000000 Z
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport