stellar-horizon 0.29.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f21b25ec3403a5aa4a6d118fb428e7e4de949ea8530ab7fc10d99f96de75477
4
- data.tar.gz: 79258881494240f18edaaba909e7afb2602ebdeaadd0cf47959383745d8d7870
3
+ metadata.gz: 8b19c1e03e74baafaa1af6f734eb3f8d39c5f4a7bfcf116e5cf955fa01b3ff13
4
+ data.tar.gz: d2ff56aca6ce259b3281f3bca75cb106a3f7df3909410a3a0c6f947d54f4aef0
5
5
  SHA512:
6
- metadata.gz: 42d1ebd3df2be5f4d436e6d83e2d04fd643aa751bc490e546420e844b7b3085fb9124139d47a0ee87d6cb41fc3a743f654b52ac8f0c0334c758f10b972da2d91
7
- data.tar.gz: 7658aac83aa40803f806eb95e7d3728c2a9bada248f0330883efe75cc99b4eaf76a0d7c4f64d9aa4557015553649e3d6f0e25025faf6e2e5b432196fcb33963d
6
+ metadata.gz: e230e354b85d64784d5df0c8fca0f6a6e9bae53bd678bfe2e100691699dfa5c22e5a6c18fa0ee81739c21aff75a63c9c418075ded07317d7829a450801239b0e
7
+ data.tar.gz: 7d915845fa142850b600172d9c7e75215e5a61ef3fc739f83323c59fa2786ea716bc53a385c5570691fe7e4f24cc471fb5495b31cec3d8361fe0f6ac0efedd2f
data/CHANGELOG.md CHANGED
@@ -7,7 +7,19 @@ 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.29.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.28.0...v0.29.0) (2021-09-07)
10
+ ## [0.31.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.30.0...v0.31.0) (2022-02-20)
11
+ * No changes
12
+
13
+ ## [0.30.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.29.0...v0.30.0) (2021-10-14)
14
+ ### Added
15
+ * `Stellar::Horizon::Problem` class moved to `stellar-horizon` gem from `stellar-sdk`
16
+ * `Stellar::TransactionPage` from `stellar-sdk` is now `Stellar::Horizon::TransactionPage` in `stellar-horizon` gem
17
+ * `faraday` and `faraday_middleware` are now direct dependencies
18
+
19
+ ### Changed
20
+ * `stellar-horizon` no longer depends on `stellar-sdk` (dependency has been reversed)
21
+
22
+ ## [0.29.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.28.0...v0.29.0) (2021-09-07)
11
23
 
12
24
  ### Added
13
25
  * 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 [Stellar::TransactionPage]
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
- Stellar::TransactionPage.new(resource)
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
- line: asset
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
@@ -1,9 +1,13 @@
1
- require "stellar-sdk"
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, "#{__dir__}/stellar/horizon/client.rb"
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.29.0
4
+ version: 0.32.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-09-07 00:00:00.000000000 Z
12
+ date: 2022-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: stellar-sdk
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.29.0
20
+ version: 0.32.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.29.0
27
+ version: 0.32.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: hyperclient
49
+ name: faraday
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.7.0
54
+ version: 1.6.0
55
55
  - - "<"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '2.0'
@@ -61,72 +61,50 @@ dependencies:
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 0.7.0
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: toml-rb
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.1
74
+ version: 1.1.0
75
75
  - - "<"
76
76
  - !ruby/object:Gem::Version
77
- version: '3.0'
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.1
84
+ version: 1.1.0
85
85
  - - "<"
86
86
  - !ruby/object:Gem::Version
87
- version: '3.0'
87
+ version: '2.0'
88
88
  - !ruby/object:Gem::Dependency
89
- name: bundler
89
+ name: hyperclient
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - "~>"
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '2.0'
95
- type: :development
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
94
+ version: 0.7.0
95
+ - - "<"
100
96
  - !ruby/object:Gem::Version
101
97
  version: '2.0'
102
- - !ruby/object:Gem::Dependency
103
- name: rake
104
- requirement: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '13'
109
- type: :development
98
+ type: :runtime
110
99
  prerelease: false
111
100
  version_requirements: !ruby/object:Gem::Requirement
112
101
  requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '13'
116
- - !ruby/object:Gem::Dependency
117
- name: rspec
118
- requirement: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
102
+ - - ">="
121
103
  - !ruby/object:Gem::Version
122
- version: '3.9'
123
- type: :development
124
- prerelease: false
125
- version_requirements: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
104
+ version: 0.7.0
105
+ - - "<"
128
106
  - !ruby/object:Gem::Version
129
- version: '3.9'
107
+ version: '2.0'
130
108
  description:
131
109
  email:
132
110
  executables: []
@@ -141,14 +119,16 @@ files:
141
119
  - README.md
142
120
  - lib/stellar-horizon.rb
143
121
  - lib/stellar/horizon/client.rb
122
+ - lib/stellar/horizon/problem.rb
123
+ - lib/stellar/horizon/transaction_page.rb
144
124
  homepage: https://github.com/stellar/ruby-stellar-sdk/tree/master/horizon
145
125
  licenses:
146
126
  - Apache-2.0
147
127
  metadata:
148
128
  github_repo: ssh://github.com/astroband/ruby-stellar-sdk
149
- documentation_uri: https://rubydoc.info/gems/stellar-sdk/0.29.0/
150
- changelog_uri: https://github.com/astroband/ruby-stellar-sdk/blob/v0.29.0/horizon/CHANGELOG.md
151
- source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.29.0/horizon
129
+ documentation_uri: https://rubydoc.info/gems/stellar-sdk/0.32.0/
130
+ changelog_uri: https://github.com/astroband/ruby-stellar-sdk/blob/v0.32.0/horizon/CHANGELOG.md
131
+ source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.32.0/horizon
152
132
  post_install_message:
153
133
  rdoc_options: []
154
134
  require_paths:
@@ -164,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
144
  - !ruby/object:Gem::Version
165
145
  version: '0'
166
146
  requirements: []
167
- rubygems_version: 3.1.4
147
+ rubygems_version: 3.1.6
168
148
  signing_key:
169
149
  specification_version: 4
170
150
  summary: Stellar Horizon client library