cardano_explorer 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +19 -0
- data/README.md +158 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ac691ba137628f992820df845f77196f17bf0241
|
4
|
+
data.tar.gz: 8690df2bf12eef2e63ed7ad0403a92f221bbc203
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4b3fab3459b65f548a7bf384e2f9cff998aa3e082a7f8268617bbda431574ce1350fdf65ce9cb6e4e4aafbc0dd9d0e53feaf98a755e00a841d7a6bc8c97031f
|
7
|
+
data.tar.gz: 0dfe3328e4b5bc4a087f5b61c6d876980eca6e0e3509a0e6b7a8f443f5fe24db8561e9368f7961e502f72ca8fd87acc0dbf046d2a34723ab94ad17a7f548fba6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,19 @@
|
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
# Cardano Explorer
|
2
|
+
|
3
|
+
A Ruby gem that wraps the Cardano SL Explorer API. At the moment, you can
|
4
|
+
retrieve summary information on addresses, transactions, and blocks.
|
5
|
+
|
6
|
+
Author: [Philip Q Nguyen](https://github.com/philipqnguyen) <br>
|
7
|
+
Copyright: Copyright (c) 2018 Philip Q Nguyen <br>
|
8
|
+
License: [MIT](http://creativecommons.org/licenses/MIT) <br>
|
9
|
+
Info: https://github.com/philipqnguyen/cardano_explorer <br>
|
10
|
+
Bugs: https://github.com/philipqnguyen/cardano_explorer/issues
|
11
|
+
|
12
|
+
If this is useful to you, consider donating Cardano to:
|
13
|
+
`DdzFFzCqrhspCkE7nghFTDKLuVqwXEzYkqzTaZLCZbrKKQEs3Ygy4f6BeP4U6SPLh8yPU4PFpGoBdZejjKG3ksigtkcirrpZusiwzvBy`
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
### Manual:
|
18
|
+
|
19
|
+
Run `gem install cardano_explorer`
|
20
|
+
|
21
|
+
### Project with Bundler or with Rails
|
22
|
+
|
23
|
+
Inside your Gemfile add:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# Gemfile
|
27
|
+
gem 'cardano_explorer'
|
28
|
+
```
|
29
|
+
|
30
|
+
Then run `bundle install`
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
### Address
|
35
|
+
|
36
|
+
Find a summary detailing the balance of an Address along with other info.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
address_id = 'Ae2tdPwUPEZKmwoy3AU3cXb5Chnasj6mvVNxV1H11997q3VW5ihbSfQwGpm'
|
40
|
+
address = CardanoExplorer::Address.find address_id
|
41
|
+
address.summary #=>
|
42
|
+
# {
|
43
|
+
# {
|
44
|
+
# "caAddress"=>"Ae2tdPwUPEZKmwoy3AU3cXb5Chnasj6mvVNxV1H11997q3VW5ihbSfQwGpm",
|
45
|
+
# "caType"=>"CPubKeyAddress",
|
46
|
+
# "caTxNum"=>0,
|
47
|
+
# "caBalance"=>{"getCoin"=>"0"},
|
48
|
+
# "caTxList"=>[]
|
49
|
+
# }
|
50
|
+
# }
|
51
|
+
```
|
52
|
+
|
53
|
+
### Transaction
|
54
|
+
|
55
|
+
Find a summary of a Transaction.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
transaction_id = 'Ae2tdPwUPEZKmwoy3AU3cXb5Chnasj6mvVNxV1H11997q3VW5ihbSfQwGpm'
|
59
|
+
transaction = CardanoExplorer::transaction.find transaction_id
|
60
|
+
transaction.summary #=>
|
61
|
+
# {
|
62
|
+
# "ctsId" => "7012fcaabcbc1be16afdaf754125c93e9216058321d4777c13c251d0cb5067fa",
|
63
|
+
# "ctsTxTimeIssued" => 1515795491,
|
64
|
+
# "ctsBlockTimeIssued" => 1515795491,
|
65
|
+
# "ctsBlockHeight" => 479560,
|
66
|
+
# "ctsBlockEpoch" => 22,
|
67
|
+
# "ctsBlockSlot" => 4420,
|
68
|
+
# "ctsBlockHash" => "c9b5db7073b66c19b11549474539578ace4b087a9f80f3a7663e40ffa9795656",
|
69
|
+
# "ctsRelayedBy" => nil,
|
70
|
+
# "ctsTotalInput" => {
|
71
|
+
# "getCoin" => "309998772700"
|
72
|
+
# },
|
73
|
+
# "ctsTotalOutput" => {
|
74
|
+
# "getCoin" => "309998601630"
|
75
|
+
# },
|
76
|
+
# "ctsFees" => {
|
77
|
+
# "getCoin" => "171070"
|
78
|
+
# },
|
79
|
+
# "ctsInputs" => [
|
80
|
+
# [
|
81
|
+
# "DdzFFzCqrht7nTVwRaq3p5xxhY8bSWPADVi2SrdVdCogncJgEPdMt1w64aujDBZb6P8G7VaqP5zFJx5iiCkYggaF8v8YRyWujTaEFDrK",
|
82
|
+
# {
|
83
|
+
# "getCoin" => "309998772700"
|
84
|
+
# }
|
85
|
+
# ]
|
86
|
+
# ],
|
87
|
+
# "ctsOutputs" => [
|
88
|
+
# [
|
89
|
+
# "DdzFFzCqrhtDEqHLUE6NLxTqQvB5Wh8bcCoUjNUxYbvo3zR8fQBvDU6Q8HNJENAqMvCdCYzbWEgiJ1ijWDYfNGL7fo7ayutic3x4hyrE",
|
90
|
+
# {
|
91
|
+
# "getCoin" => "308997601630"
|
92
|
+
# }
|
93
|
+
# ],
|
94
|
+
# [
|
95
|
+
# "DdzFFzCqrhsnLSqJSwcxFM6CndnsUYESBoXkr8zrTqjXq4uzaeh6spni6bUbZXLAHBjbfCh9YzJN7xyHUV4XTqkg9ivP5NURE9kHF9U6",
|
96
|
+
# {
|
97
|
+
# "getCoin" => "1001000000"
|
98
|
+
# }
|
99
|
+
# ]
|
100
|
+
# ]
|
101
|
+
# }
|
102
|
+
```
|
103
|
+
|
104
|
+
### Block
|
105
|
+
|
106
|
+
Find a summary of a Block.
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
block_id = 'd3fdc8c8ea4050cc87a21cb73110d54e3ec92f8ae76941e8a1957ed6e6a7e0b0'
|
110
|
+
block = CardanoExplorer::Block.find block_id
|
111
|
+
block.summary #=>
|
112
|
+
# {
|
113
|
+
# 'cbsEntry' => {
|
114
|
+
# 'cbeEpoch' => 0,
|
115
|
+
# 'cbeSlot' => 29,
|
116
|
+
# 'cbeBlkHash' => 'd3fdc8c8ea4050cc87a21cb73110d54e3ec92f8ae76941e8a1957ed6e6a7e0b0',
|
117
|
+
# 'cbeTimeIssued' => 1506203671,
|
118
|
+
# 'cbeTxNum' => 0,
|
119
|
+
# 'cbeTotalSent' => {
|
120
|
+
# 'getCoin' => '0'
|
121
|
+
# },
|
122
|
+
# 'cbeSize' => 667,
|
123
|
+
# 'cbeBlockLead' => '6c9e14978b9d6629b8703f4f25e9df6ed4814b930b8403b0d45350ea',
|
124
|
+
# 'cbeFees' => {
|
125
|
+
# 'getCoin' => '0'
|
126
|
+
# }
|
127
|
+
# },
|
128
|
+
# 'cbsPrevHash' => '35837ea76e42d5f0bc3309127c9deb92e87d449ffc7d864d5eee3cbd63b2574a',
|
129
|
+
# 'cbsNextHash' => 'bfd2d6b38a6e16e5710d5e6eedefaf30fe7e15753a4cb9e8da95d0a9b10525c5',
|
130
|
+
# 'cbsMerkleRoot' => '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8'
|
131
|
+
# }
|
132
|
+
```
|
133
|
+
|
134
|
+
## Configuring
|
135
|
+
|
136
|
+
You can change the root url like so:
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
CardanoExplorer.configuration do |config|
|
140
|
+
config.root_url = 'https://cardanoexplorer.com' # This is the default
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
## Contributing
|
145
|
+
|
146
|
+
Issues and pull requests are welcome on GitHub at https://github.com/philipqnguyen/cardano_explorer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
147
|
+
|
148
|
+
## Development and testing
|
149
|
+
|
150
|
+
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment.
|
151
|
+
|
152
|
+
## Releasing
|
153
|
+
|
154
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
155
|
+
|
156
|
+
## License
|
157
|
+
|
158
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cardano_explorer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Philip Nguyen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.15.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.15.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.2'
|
83
|
+
description: A Ruby API wrapper to query the Cardano SL Explorer
|
84
|
+
email: supertaru@gmail.com
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files: []
|
88
|
+
files:
|
89
|
+
- LICENSE.txt
|
90
|
+
- README.md
|
91
|
+
homepage: https://github.com/philipqnguyen/cardano_explorer
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata: {}
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.2.2
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 2.6.11
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: A Ruby API wrapper to query the Cardano SL Explorer
|
115
|
+
test_files: []
|