cardano_explorer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +26 -0
- data/lib/cardano_explorer/address.rb +1 -1
- data/lib/cardano_explorer/base.rb +5 -4
- data/lib/cardano_explorer/block.rb +1 -1
- data/lib/cardano_explorer/genesis.rb +2 -2
- data/lib/cardano_explorer/transaction.rb +5 -1
- data/lib/cardano_explorer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e98f116c8f05f9975b3558f0263e4488da9070cc
|
4
|
+
data.tar.gz: d2a9b41cb310a8752dc1fc113136a285fdbec697
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db8b5c6b918029147ecda60eb1f30fc4ce35cd5ffbb05daf480464218f5188910077a5010071e3435187643516e9f5af3af77f82700c807623076ca2280d046
|
7
|
+
data.tar.gz: f7557a9216ddf8731b6044d575ff040ce1d477ccf0583799a6ffad2140c37d0f8536efaeb023d1439efcadb143791f87418cdc97c4ba307d8fa7f183ce0e3767
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/philipqnguyen/cardano_explorer.svg?branch=master)](https://travis-ci.org/philipqnguyen/cardano_explorer)
|
2
|
+
|
1
3
|
# Cardano Explorer
|
2
4
|
|
3
5
|
A Ruby gem that wraps the Cardano SL Explorer API. At the moment, you can
|
@@ -101,6 +103,30 @@ transaction.summary #=>
|
|
101
103
|
# }
|
102
104
|
```
|
103
105
|
|
106
|
+
Get the latest transactions.
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
CardanoExplorer::Transaction.latest #=>
|
110
|
+
# [
|
111
|
+
# #<CardanoExplorer::Transaction:0x00000001b39808 @hash="d5a71c0a0e59d57d17c2e3466447fdd58e312dd99c0e3d07682b9796ce7aec69">,
|
112
|
+
# #<CardanoExplorer::Transaction:0x00000001b397e0 @hash="fb91a2d4943e70cd85c65d036962ba915544a5d963d26f4cd3ea8d9eb55d3040">,
|
113
|
+
# ...
|
114
|
+
# ]
|
115
|
+
```
|
116
|
+
|
117
|
+
Each of these is an instance of `CardanoExplorer::Transaction` with its methods.
|
118
|
+
|
119
|
+
```ruby
|
120
|
+
transactions = CardanoExplorer::Transaction.latest
|
121
|
+
transactions.first.summary #=>
|
122
|
+
# {
|
123
|
+
# "ctsId" => "7012fcaabcbc1be16afdaf754125c93e9216058321d4777c13c251d0cb5067fa",
|
124
|
+
# "ctsTxTimeIssued" => 1515795491,
|
125
|
+
# "ctsBlockTimeIssued" => 1515795491,
|
126
|
+
# ...
|
127
|
+
# }
|
128
|
+
```
|
129
|
+
|
104
130
|
### Block
|
105
131
|
|
106
132
|
Find a summary of a Block.
|
@@ -11,22 +11,23 @@ module CardanoExplorer
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def summary
|
14
|
-
@summary ||= get "summary/#{hash}"
|
14
|
+
@summary ||= self.class.get "summary/#{hash}"
|
15
15
|
@summary.parsed_response['Right']
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
19
|
|
20
|
-
def get(path, options = {})
|
20
|
+
def self.get(path, options = {})
|
21
21
|
HTTParty.get "#{root_url}/#{endpoint}/#{path}", query: options
|
22
22
|
end
|
23
23
|
|
24
|
-
def root_url
|
24
|
+
def self.root_url
|
25
25
|
CardanoExplorer.configuration.root_url
|
26
26
|
end
|
27
27
|
|
28
|
-
def endpoint
|
28
|
+
def self.endpoint
|
29
29
|
raise NotImplementedError, '#endpoint not defined in child class'
|
30
30
|
end
|
31
|
+
|
31
32
|
end
|
32
33
|
end
|
@@ -8,12 +8,12 @@ module CardanoExplorer
|
|
8
8
|
def pages_total(options = {})
|
9
9
|
valid_params = %w[pageSize redeemeed]
|
10
10
|
options = options.keep_if { |k| valid_params.include?(k) }
|
11
|
-
get('address/pages/total', options).parsed_response['Right']
|
11
|
+
self.class.get('address/pages/total', options).parsed_response['Right']
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def endpoint
|
16
|
+
def self.endpoint
|
17
17
|
'api/genesis'
|
18
18
|
end
|
19
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.4.5
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: A Ruby API wrapper to query the Cardano SL Explorer
|