eth-rb 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eth.rb +7 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6ddedc90f9cea9a890fed169bc06426a9740fe09888922f05a02633632821f4
|
|
4
|
+
data.tar.gz: d68c12983f6df10b79a2eac26cf1a4f7e6687c463c830cdb67b5c2c16543bc17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9e5c89e8f40564acbe032c98c49c9b7b63ad249bae9dde561de6b29bdbf334b7b620122f2a70337fd350115037ecaa2c9f501f3b678f8435a6ca84af72c1456
|
|
7
|
+
data.tar.gz: 55096bdc99198469b2f889a300d14e27556ad557b0722391b07a6644976e836ad24adca7d454ab30648b4d682ba3d8032e49a57e97043fc129f3c04ea1e40ccc
|
data/lib/eth.rb
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# ./eth.rb send <key> <to> $<amount> — send ETH (amount in USD, converted at current price)
|
|
11
11
|
# ./eth.rb --help — show this usage info
|
|
12
12
|
|
|
13
|
-
require "bundler/setup"
|
|
14
13
|
require "net/http"
|
|
15
14
|
require "json"
|
|
16
15
|
require "uri"
|
|
@@ -21,6 +20,7 @@ require "digest/keccak"
|
|
|
21
20
|
ALCHEMY_URL = "https://eth-mainnet.g.alchemy.com/v2/alch_PhpVkmsabZhYV69otj1rF"
|
|
22
21
|
COINGECKO_URL = "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"
|
|
23
22
|
CHAIN_ID = 1 # Ethereum mainnet
|
|
23
|
+
VERSION = "0.1.1"
|
|
24
24
|
|
|
25
25
|
# ── JSON-RPC ────────────────────────────────────────────────────────────────
|
|
26
26
|
|
|
@@ -315,6 +315,10 @@ def show_price
|
|
|
315
315
|
puts "ETH/USD: $#{format("%.2f", price)}"
|
|
316
316
|
end
|
|
317
317
|
|
|
318
|
+
def show_version
|
|
319
|
+
puts "eth.rb v#{VERSION}"
|
|
320
|
+
end
|
|
321
|
+
|
|
318
322
|
def print_usage
|
|
319
323
|
puts File.read(__FILE__)[/^#\sUsage:.*?(?=\n\n)/m]
|
|
320
324
|
end
|
|
@@ -326,6 +330,8 @@ def run_cli(args)
|
|
|
326
330
|
show_block_number
|
|
327
331
|
elsif args[0] == "--price"
|
|
328
332
|
show_price
|
|
333
|
+
elsif args[0] == "--version" || args[0] == "-v"
|
|
334
|
+
show_version
|
|
329
335
|
elsif args[0] == "--help" || args[0] == "-h"
|
|
330
336
|
print_usage
|
|
331
337
|
elsif args[0] == "send"
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eth-rb
|
|
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
|
- Khalid Shaikh
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ecdsa
|
|
@@ -55,7 +54,6 @@ homepage: https://github.com/kshaikh/eth.rb
|
|
|
55
54
|
licenses:
|
|
56
55
|
- MIT
|
|
57
56
|
metadata: {}
|
|
58
|
-
post_install_message:
|
|
59
57
|
rdoc_options: []
|
|
60
58
|
require_paths:
|
|
61
59
|
- lib
|
|
@@ -70,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
70
68
|
- !ruby/object:Gem::Version
|
|
71
69
|
version: '0'
|
|
72
70
|
requirements: []
|
|
73
|
-
rubygems_version:
|
|
74
|
-
signing_key:
|
|
71
|
+
rubygems_version: 4.0.17
|
|
75
72
|
specification_version: 4
|
|
76
73
|
summary: Ethereum blockchain queries via Alchemy JSON-RPC
|
|
77
74
|
test_files: []
|