stellar-horizon 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/lib/stellar/horizon/client.rb +3 -48
- data/lib/stellar/horizon/problem.rb +45 -0
- data/lib/stellar/horizon/transaction_page.rb +25 -0
- data/lib/stellar-horizon.rb +6 -2
- metadata +39 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15b99857cacc22135cf35f1e24491919a8066e13baa1f53bb23c93a2af8b70d8
|
4
|
+
data.tar.gz: 9af6d7281c2c1beb22c09e1d91fde25fd916c6fe353a4db5c2e0da5f07a98b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 821698402b911065f5fb1c9e1e503a645530b745d06086414fbfddbd2689435581b2ca4672e5a15647f8991c65a00ce3d1c8e8a2a66aabd8f0fcda52730568c1
|
7
|
+
data.tar.gz: 5a34e8098bd454dabf69ee6c6c69eda9d5c09fcded4c8be868951e828f1bc85e51d94837ee22693b37effb949860fa045a62779d79b1d75663a152ad1066c868
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
As this project is pre 1.0, breaking changes may happen for minor version
|
8
8
|
bumps. A breaking change will get clearly notified in this log.
|
9
9
|
|
10
|
-
## [0.
|
10
|
+
## [0.30.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.29.0...v0.30.0) (2021-10-14)
|
11
|
+
### Added
|
12
|
+
* `Stellar::Horizon::Problem` class moved to `stellar-horizon` gem from `stellar-sdk`
|
13
|
+
* `Stellar::TransactionPage` from `stellar-sdk` is now `Stellar::Horizon::TransactionPage` in `stellar-horizon` gem
|
14
|
+
* `faraday` and `faraday_middleware` are now direct dependencies
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
* `stellar-horizon` no longer depends on `stellar-sdk` (dependency has been reversed)
|
18
|
+
|
19
|
+
## [0.29.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.28.0...v0.29.0) (2021-09-07)
|
11
20
|
|
12
21
|
### Added
|
13
22
|
* Initial setup of the gem, copying all Horizon-related features from `sdk` gem
|
@@ -147,7 +147,7 @@ module Stellar::Horizon
|
|
147
147
|
# @option options [Stellar::Account] :account
|
148
148
|
# @option options [Integer] :limit
|
149
149
|
# @option options [Integer] :cursor
|
150
|
-
# @return [
|
150
|
+
# @return [TransactionPage]
|
151
151
|
def transactions(options = {})
|
152
152
|
args = options.slice(:limit, :cursor)
|
153
153
|
|
@@ -158,7 +158,7 @@ module Stellar::Horizon
|
|
158
158
|
@horizon.transactions(args)
|
159
159
|
end
|
160
160
|
|
161
|
-
|
161
|
+
TransactionPage.new(resource)
|
162
162
|
end
|
163
163
|
|
164
164
|
# @param [Array(Symbol,String,Stellar::KeyPair|Stellar::Account)] asset
|
@@ -178,7 +178,7 @@ module Stellar::Horizon
|
|
178
178
|
op_args = {
|
179
179
|
account: source.keypair,
|
180
180
|
sequence: sequence,
|
181
|
-
|
181
|
+
asset: asset
|
182
182
|
}
|
183
183
|
op_args[:limit] = limit unless limit.nil?
|
184
184
|
|
@@ -249,50 +249,5 @@ module Stellar::Horizon
|
|
249
249
|
end
|
250
250
|
end
|
251
251
|
end
|
252
|
-
|
253
|
-
# DEPRECATED: this function has been moved Stellar::SEP10.build_challenge_tx and
|
254
|
-
# will be removed in the next major version release.
|
255
|
-
#
|
256
|
-
# A wrapper function for Stellar::SEP10::build_challenge_tx.
|
257
|
-
#
|
258
|
-
# @param server [Stellar::KeyPair] Keypair for server's signing account.
|
259
|
-
# @param client [Stellar::KeyPair] Keypair for the account whishing to authenticate with the server.
|
260
|
-
# @param anchor_name [String] Anchor's name to be used in the manage_data key.
|
261
|
-
# @param timeout [Integer] Challenge duration (default to 5 minutes).
|
262
|
-
#
|
263
|
-
# @return [String] A base64 encoded string of the raw TransactionEnvelope xdr struct for the transaction.
|
264
|
-
def build_challenge_tx(server:, client:, anchor_name:, timeout: 300)
|
265
|
-
Stellar::SEP10.build_challenge_tx(
|
266
|
-
server: server, client: client, anchor_name: anchor_name, timeout: timeout
|
267
|
-
)
|
268
|
-
end
|
269
|
-
|
270
|
-
# DEPRECATED: this function has been moved to Stellar::SEP10::read_challenge_tx and
|
271
|
-
# will be removed in the next major version release.
|
272
|
-
#
|
273
|
-
# A wrapper function for Stellar::SEP10.verify_challenge_transaction
|
274
|
-
#
|
275
|
-
# @param challenge [String] SEP0010 transaction challenge in base64.
|
276
|
-
# @param server [Stellar::KeyPair] Stellar::KeyPair for server where the challenge was generated.
|
277
|
-
#
|
278
|
-
# @return [Boolean]
|
279
|
-
def verify_challenge_tx(challenge:, server:)
|
280
|
-
Stellar::SEP10.verify_challenge_tx(challenge_xdr: challenge, server: server)
|
281
|
-
true
|
282
|
-
end
|
283
|
-
|
284
|
-
# DEPRECATED: this function has been moved to Stellar::SEP10::verify_tx_signed_by and
|
285
|
-
# will be removed in the next major version release.
|
286
|
-
#
|
287
|
-
# @param transaction_envelope [Stellar::TransactionEnvelope]
|
288
|
-
# @param keypair [Stellar::KeyPair]
|
289
|
-
#
|
290
|
-
# @return [Boolean]
|
291
|
-
#
|
292
|
-
def verify_tx_signed_by(transaction_envelope:, keypair:)
|
293
|
-
Stellar::SEP10.verify_tx_signed_by(
|
294
|
-
tx_envelope: transaction_envelope, keypair: keypair
|
295
|
-
)
|
296
|
-
end
|
297
252
|
end
|
298
253
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Stellar
|
2
|
+
module Horizon
|
3
|
+
class Problem
|
4
|
+
def initialize(attributes)
|
5
|
+
@attributes = attributes.reverse_merge({
|
6
|
+
type: "about:blank",
|
7
|
+
title: "Unknown Error",
|
8
|
+
status: 500
|
9
|
+
})
|
10
|
+
|
11
|
+
@meta = @attributes.except!(:type, :title, :status, :detail, :instance)
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [String]
|
15
|
+
def type
|
16
|
+
@attributes[:type]
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
def title
|
21
|
+
@attributes[:title]
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [Integer]
|
25
|
+
def status
|
26
|
+
@attributes[:status]
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [String]
|
30
|
+
def detail
|
31
|
+
@attributes[:detail]
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [String]
|
35
|
+
def instance
|
36
|
+
@attributes[:instance]
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [{String => Object}]
|
40
|
+
def meta
|
41
|
+
@attributes[:instance]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Stellar::Horizon
|
2
|
+
class TransactionPage
|
3
|
+
include Enumerable
|
4
|
+
|
5
|
+
# @param [Hyperclient::Link] resource
|
6
|
+
def initialize(resource)
|
7
|
+
@resource = resource
|
8
|
+
end
|
9
|
+
|
10
|
+
def each
|
11
|
+
@resource.records.each do |tx|
|
12
|
+
yield tx if block_given?
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Stellar::TransactionPage]
|
17
|
+
def next_page
|
18
|
+
self.class.new(@resource.next)
|
19
|
+
end
|
20
|
+
|
21
|
+
def next_page!
|
22
|
+
@resource = @resource.next
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/stellar-horizon.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
require "stellar-
|
1
|
+
require "stellar-base"
|
2
2
|
|
3
3
|
module Stellar
|
4
4
|
module Horizon
|
5
|
+
extend ActiveSupport::Autoload
|
6
|
+
|
5
7
|
VERSION = ::Stellar::VERSION
|
6
8
|
|
7
|
-
autoload :Client
|
9
|
+
autoload :Client
|
10
|
+
autoload :Problem
|
11
|
+
autoload :TransactionPage
|
8
12
|
end
|
9
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stellar-horizon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nebolsin
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name: stellar-
|
15
|
+
name: stellar-base
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.30.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.30.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: excon
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,12 +46,12 @@ dependencies:
|
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: faraday
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.6.0
|
55
55
|
- - "<"
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '2.0'
|
@@ -61,30 +61,50 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: 1.6.0
|
65
65
|
- - "<"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '2.0'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
69
|
+
name: faraday_middleware
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.1.
|
74
|
+
version: 1.1.0
|
75
75
|
- - "<"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
77
|
+
version: '2.0'
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 1.1.
|
84
|
+
version: 1.1.0
|
85
85
|
- - "<"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
87
|
+
version: '2.0'
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: hyperclient
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.7.0
|
95
|
+
- - "<"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '2.0'
|
98
|
+
type: :runtime
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 0.7.0
|
105
|
+
- - "<"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '2.0'
|
88
108
|
- !ruby/object:Gem::Dependency
|
89
109
|
name: bundler
|
90
110
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,14 +161,16 @@ files:
|
|
141
161
|
- README.md
|
142
162
|
- lib/stellar-horizon.rb
|
143
163
|
- lib/stellar/horizon/client.rb
|
164
|
+
- lib/stellar/horizon/problem.rb
|
165
|
+
- lib/stellar/horizon/transaction_page.rb
|
144
166
|
homepage: https://github.com/stellar/ruby-stellar-sdk/tree/master/horizon
|
145
167
|
licenses:
|
146
168
|
- Apache-2.0
|
147
169
|
metadata:
|
148
170
|
github_repo: ssh://github.com/astroband/ruby-stellar-sdk
|
149
|
-
documentation_uri: https://rubydoc.info/gems/stellar-sdk/0.
|
150
|
-
changelog_uri: https://github.com/astroband/ruby-stellar-sdk/blob/v0.
|
151
|
-
source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.
|
171
|
+
documentation_uri: https://rubydoc.info/gems/stellar-sdk/0.30.0/
|
172
|
+
changelog_uri: https://github.com/astroband/ruby-stellar-sdk/blob/v0.30.0/horizon/CHANGELOG.md
|
173
|
+
source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.30.0/horizon
|
152
174
|
post_install_message:
|
153
175
|
rdoc_options: []
|
154
176
|
require_paths:
|
@@ -164,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
186
|
- !ruby/object:Gem::Version
|
165
187
|
version: '0'
|
166
188
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
189
|
+
rubygems_version: 3.2.22
|
168
190
|
signing_key:
|
169
191
|
specification_version: 4
|
170
192
|
summary: Stellar Horizon client library
|