cardano_explorer 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/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/cardano_explorer.rb +17 -0
- data/lib/cardano_explorer/address.rb +10 -0
- data/lib/cardano_explorer/base.rb +31 -0
- data/lib/cardano_explorer/block.rb +10 -0
- data/lib/cardano_explorer/configuration.rb +9 -0
- data/lib/cardano_explorer/transaction.rb +10 -0
- data/lib/cardano_explorer/version.rb +3 -0
- metadata +9 -2
- data/LICENSE.txt +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37e15cc6db2c6c92806377105bc34bb0a16cb334
|
4
|
+
data.tar.gz: f0f227756c77307b4ce1f3da91393aa008665537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 117da5f4240ce42cf108f7ef8a563ab618f728a75d7c5eb4dbd2ebae5bb4f20ac893b1a7d6da53b820fa973ac2850449dae389f03f3fd576037a8b937d9f0cf5
|
7
|
+
data.tar.gz: ef744ce03536924843534cc05abb192c78ef6bb2abe40e4d51d60282a4c05a153774494dd5f8f1f810b9ea104987005ff76774cab035ba08fe3076e5aedc2e69
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -55,8 +55,8 @@ address.summary #=>
|
|
55
55
|
Find a summary of a Transaction.
|
56
56
|
|
57
57
|
```ruby
|
58
|
-
transaction_id = '
|
59
|
-
transaction = CardanoExplorer::
|
58
|
+
transaction_id = '7012fcaabcbc1be16afdaf754125c93e9216058321d4777c13c251d0cb5067fa'
|
59
|
+
transaction = CardanoExplorer::Transaction.find transaction_id
|
60
60
|
transaction.summary #=>
|
61
61
|
# {
|
62
62
|
# "ctsId" => "7012fcaabcbc1be16afdaf754125c93e9216058321d4777c13c251d0cb5067fa",
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'cardano_explorer/version'
|
3
|
+
require 'cardano_explorer/configuration'
|
4
|
+
require 'cardano_explorer/base'
|
5
|
+
require 'cardano_explorer/address'
|
6
|
+
require 'cardano_explorer/block'
|
7
|
+
require 'cardano_explorer/transaction'
|
8
|
+
|
9
|
+
module CardanoExplorer
|
10
|
+
def self.configuration
|
11
|
+
@configuration ||= Configuration.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.configure
|
15
|
+
yield configuration if block_given?
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module CardanoExplorer
|
2
|
+
class Base
|
3
|
+
attr_reader :hash
|
4
|
+
|
5
|
+
def self.find(hash)
|
6
|
+
new hash
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize(hash)
|
10
|
+
@hash = hash
|
11
|
+
end
|
12
|
+
|
13
|
+
def summary
|
14
|
+
response.parsed_response['Right']
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def response
|
20
|
+
@response ||= HTTParty.get "#{root_url}/#{endpoint}/#{hash}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def root_url
|
24
|
+
CardanoExplorer.configuration.root_url
|
25
|
+
end
|
26
|
+
|
27
|
+
def endpoint
|
28
|
+
raise NotImplementedError, '#endpoint not defined in child class'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardano_explorer
|
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
|
- Philip Nguyen
|
@@ -86,8 +86,15 @@ executables: []
|
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|
88
88
|
files:
|
89
|
-
-
|
89
|
+
- CHANGELOG.md
|
90
90
|
- README.md
|
91
|
+
- lib/cardano_explorer.rb
|
92
|
+
- lib/cardano_explorer/address.rb
|
93
|
+
- lib/cardano_explorer/base.rb
|
94
|
+
- lib/cardano_explorer/block.rb
|
95
|
+
- lib/cardano_explorer/configuration.rb
|
96
|
+
- lib/cardano_explorer/transaction.rb
|
97
|
+
- lib/cardano_explorer/version.rb
|
91
98
|
homepage: https://github.com/philipqnguyen/cardano_explorer
|
92
99
|
licenses:
|
93
100
|
- MIT
|
data/LICENSE.txt
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (c) 2018 Philip Q Nguyen
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|