indium 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/indium.rb +19 -13
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9de121060c7be66bd786f70b64b4acecf72749eee12b150931ccd085458269d
4
- data.tar.gz: 7db522a2f5a615431aed2e779403b506e9747dfcb19804535f3e3a07970b76ca
3
+ metadata.gz: 11bbf2c8eb8bbb572f3c332cfee396c2c659ccd6d891499d4cb5dfa20e6742c9
4
+ data.tar.gz: 2df750377bce322269e2144207ce210fcc210a8efd345eace3b74768f849a561
5
5
  SHA512:
6
- metadata.gz: cfb240ec4b2316a2290c83405d8238195c82351d552088357f9d48e49268594b34557927675b268641bb2a1f289e4263c224c496bc44c5e2d528bf914eddb0ae
7
- data.tar.gz: 80b83e3290f2990973125c6b803089062514f25a64e05caa929335e4ba977490a4baafbff26fa5c4f6b117470fad1f455d68a24fae2945b5febf04856d3a7b88
6
+ metadata.gz: a9ef211279d9f339a81b34480af3549afc02d08a84d28665e10a6ad7b0ed1db78e1460bd82d9d218fc8f212b9c3ab7bb017768d473e014e4ad587cf56ae3f02f
7
+ data.tar.gz: 355900ab2772e0a67a140ce2f11bd2cb93215e0d8550b383da4df59d34d7b8c7ea64c7562b66a2a7180201a4267b06a761497f6cc116c3dbfa1161caabb11581
data/lib/indium.rb CHANGED
@@ -24,19 +24,25 @@ class Indium
24
24
  end
25
25
 
26
26
  def transfer(signtxn_url, sender_privkey, receiver_pubkey, amount, hex_data = "", gas_limit = 21_000, gas_price = 3_141_592)
27
- http = HTTPClient.new
28
- params = {
29
- "rpc" => @node_url,
30
- "receiver" => receiver_pubkey,
31
- "sender" => Eth::Key.new(priv: sender_privkey).address,
32
- "privkey" => sender_privkey,
33
- "amount" => amount,
34
- "gaslimit" => gas_limit,
35
- "gasprice" => gas_price,
36
- "chain" => @chain_id,
37
- "data" => hex_data
38
- }
39
- return http.post(signtxn_url, params)
27
+ if signtxn_url
28
+ http = HTTPClient.new
29
+ params = {
30
+ "rpc" => @node_url,
31
+ "receiver" => receiver_pubkey,
32
+ "sender" => Eth::Key.new(priv: sender_privkey).address,
33
+ "privkey" => sender_privkey,
34
+ "amount" => amount,
35
+ "gaslimit" => gas_limit,
36
+ "gasprice" => gas_price,
37
+ "chain" => @chain_id,
38
+ "data" => hex_data
39
+ }
40
+ return http.post(signtxn_url, params)
41
+ else
42
+ @client.gas_price = gas_price
43
+ @client.gas_limit = gas_limit
44
+ return @client.transfer(sender_privkey, receiver_pubkey, amount)
45
+ end
40
46
  end
41
47
 
42
48
  def wei_to_eth_str(w)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nilesh Trivedi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-21 00:00:00.000000000 Z
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eth
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.6
19
+ version: 0.4.10
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.6
26
+ version: 0.4.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ethereum.rb
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.7.3
82
+ rubygems_version: 2.7.8
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Indium