indium 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/indium.rb +19 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11bbf2c8eb8bbb572f3c332cfee396c2c659ccd6d891499d4cb5dfa20e6742c9
|
4
|
+
data.tar.gz: 2df750377bce322269e2144207ce210fcc210a8efd345eace3b74768f849a561
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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.
|
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-
|
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.
|
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.
|
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.
|
82
|
+
rubygems_version: 2.7.8
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Indium
|