indium 0.1.0 → 0.1.1

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 +5 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acf0e6d7ec868e722ba35b8c69e224085c36dbaf879444d2fabb2fbc615d82f3
4
- data.tar.gz: c6082918207b40ef23e0ad927b27de53d4ba8c65b173a26c0e86f72b8685927f
3
+ metadata.gz: 81888e223903baaaeda662004b7689a787f3fd64cf9fd7f8f2ba5780c0808e8d
4
+ data.tar.gz: 4b638de4128e6603b5842de1bca75bceda73df0b79fab582e2462211125b1129
5
5
  SHA512:
6
- metadata.gz: 604b7d0408f182d9cd04f1b993aa773de734598eeed0b7934002cc8737ffec1cd9d256735bb0311dd2cd2bac0cdcc0fd5cf3ad3e08a928c9342993d0adaa87c3
7
- data.tar.gz: c7d5242b1bdd419ba1f173ab8a5dad47e403c3383021f9b6fd5a86e3f60de1be2186efff451e31de060c03471948621c3dd7e91f433ef2708ea2ac63abf37d49
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.eth_get_balance(pubkey)
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(privkey)
24
+ def create_indium_account
23
25
  kp = Eth::Key.new
24
- return [kp.address, kp.private_hex]
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.0
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.8
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.8
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: []