indium 0.1.0 → 0.1.1
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 +5 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81888e223903baaaeda662004b7689a787f3fd64cf9fd7f8f2ba5780c0808e8d
|
4
|
+
data.tar.gz: 4b638de4128e6603b5842de1bca75bceda73df0b79fab582e2462211125b1129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f4a04cc252d9a512085bfa34de72796c524813ddd9a40c69a8faa8518c713722ab103495339c928512f7999f4f9dba6d8e7ca8569070076ebe8e8fa5b3fc11
|
7
|
+
data.tar.gz: 4f6ba1d6e78f6d43eaecc0e28985a8ddb35c381d18968f7bc9e19014808534f79afa25f27b7e65d6297c828b55cfd1259fd493e8433899c98b7c52da2420eb53
|
data/lib/indium.rb
CHANGED
@@ -2,6 +2,8 @@ require 'ethereum.rb'
|
|
2
2
|
require 'eth'
|
3
3
|
|
4
4
|
class Indium
|
5
|
+
attr_reader :client
|
6
|
+
|
5
7
|
def initialize(node_url, chain_id)
|
6
8
|
Eth.configure do |config|
|
7
9
|
config.chain_id = chain_id # nil by default, meaning valid on any chain
|
@@ -10,7 +12,7 @@ class Indium
|
|
10
12
|
end
|
11
13
|
|
12
14
|
def balance(pubkey)
|
13
|
-
@client.
|
15
|
+
@client.get_balance(pubkey)
|
14
16
|
end
|
15
17
|
|
16
18
|
def transfer(sender_privkey, receiver_pubkey, amount, hex_data, gas_limit = 21_000, gas_price = 3_141_592)
|
@@ -19,9 +21,9 @@ class Indium
|
|
19
21
|
@client.transfer(sender_privkey, receiver_pubkey, amount) # transfer_and_wait ?
|
20
22
|
end
|
21
23
|
|
22
|
-
def create_indium_account
|
24
|
+
def create_indium_account
|
23
25
|
kp = Eth::Key.new
|
24
|
-
return
|
26
|
+
return kp.address, kp.private_hex
|
25
27
|
end
|
26
28
|
|
27
29
|
def self.local
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nilesh Trivedi
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.1
|
33
|
+
version: '2.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.1
|
40
|
+
version: '2.1'
|
41
41
|
description: Library for querying/posting transactions from the Indium network
|
42
42
|
email: github@nileshtrivedi.com
|
43
43
|
executables: []
|