stellar-sdk 0.6.0 → 0.7.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
- SHA1:
3
- metadata.gz: 4f4c58d5a53d9bfd6d7738fe6d70cabb61c0d6fe
4
- data.tar.gz: f580c29fc169d126e7546589f03d675c5aaee307
2
+ SHA256:
3
+ metadata.gz: 3390d577fe288a6397d9f1c2844729023abc68b3147584211794d1d0eed294b2
4
+ data.tar.gz: 01ce41b3d2a9be6ea02196e14639a379955b584744435a622d7091840426358e
5
5
  SHA512:
6
- metadata.gz: e38b8a8b03360f65fe9e739806cb0b2fbddc563026c61a512e75c1f5808cf5c5e20b0a195e60bbc50d2bfff1c72a255717f74de05d65f586063d42ce2756a6f6
7
- data.tar.gz: 85afab30aa425ee7fb29a5d2b919fb7f2fc556369186665f7d513704dac4881aa8fbe6362bcce9bd5ace283c0c2046873a6d4a2cd9c9b16993b58d4828540100
6
+ metadata.gz: c740fe9977ea1dd2ae41ce0f2c4001eec2142d3adafe2739a2ec7deed9ba60f31419ad1f63c8d63b91cbc565146f855f5041f4171e2e324bda8770f1eae7d12b
7
+ data.tar.gz: 563d52017e9767190f0bd09d1fdf0dfe17903dfb55820b53ca24be6eabd2e4cc8d3896a6bf4148ee6f2fcdbec89fecba08ec7b012a5d2258bf6fd354bbac28d0
@@ -0,0 +1,2 @@
1
+ # Each line is a file pattern followed by one or more owners.
2
+ * @ramontayag
data/.travis.yml CHANGED
@@ -1,11 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.1
4
3
  - 2.4.1
5
4
  - 2.5.1
5
+ - 2.6.1
6
6
  - jruby-9.1.6.0
7
7
  cache: bundler
8
8
  before_install:
9
+ - gem update --system
10
+ - gem install bundler -v 2.0
9
11
  - sudo add-apt-repository -y ppa:chris-lea/libsodium
10
12
  - sudo apt-get -y update
11
13
  - sudo apt-get install -y libsodium-dev
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.7.0] - 2019-04-26
8
+ ### Added
9
+ - Friendbot support
10
+
7
11
  ## [0.6.0] - 2018-11-27
8
12
  ### Added
9
13
  - Allow setting of memo in `Stellar::Client#send_payment`
@@ -11,6 +11,7 @@ module Stellar
11
11
  HORIZON_LOCALHOST_URL = 'http://127.0.0.1:8000'
12
12
  HORIZON_MAINNET_URL = 'https://horizon.stellar.org'
13
13
  HORIZON_TESTNET_URL = 'https://horizon-testnet.stellar.org'
14
+ FRIENDBOT_URL = 'https://friendbot.stellar.org'.freeze
14
15
 
15
16
  def self.default(options={})
16
17
  new options.merge(
@@ -76,7 +77,9 @@ module Stellar
76
77
  end
77
78
 
78
79
  def friendbot(account)
79
- raise NotImplementedError
80
+ uri = URI.parse(FRIENDBOT_URL)
81
+ uri.query = "addr=#{account.address}"
82
+ Faraday.post(uri.to_s)
80
83
  end
81
84
 
82
85
  Contract ({
@@ -1,3 +1,3 @@
1
1
  module Stellar
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Scott Fleckenstein"]
10
10
  spec.email = ["scott@stellar.org"]
11
11
  spec.summary = %q{Stellar client library}
12
- spec.homepage = "http://github.com/stellar/ruby-stellar-sdk"
12
+ spec.homepage = "http://github.com/bloom-solutions/ruby-stellar-sdk"
13
13
  spec.license = "Apache 2.0"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "hyperclient", "~> 0.7"
22
22
  spec.add_dependency "excon", "~> 0.44", ">= 0.44.4"
23
23
  spec.add_dependency "contracts", "~> 0.16"
24
- spec.add_dependency "activesupport", ">= 5.2.0"
24
+ spec.add_dependency "activesupport", ">= 5.0"
25
25
  spec.add_dependency "toml-rb", "~> 1.1", ">= 1.1.1"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.16"
27
+ spec.add_development_dependency "bundler", "~> 2.0"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.1"
30
30
  spec.add_development_dependency "guard-rspec"
@@ -0,0 +1,246 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://friendbot.stellar.org/?addr=GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Content-Length:
13
+ - '0'
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Disposition:
24
+ - inline
25
+ Content-Type:
26
+ - application/hal+json; charset=utf-8
27
+ Date:
28
+ - Wed, 27 Feb 2019 13:37:42 GMT
29
+ Vary:
30
+ - Origin
31
+ Content-Length:
32
+ - '1305'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ {
39
+ "_links": {
40
+ "transaction": {
41
+ "href": "https://horizon-testnet.stellar.org/transactions/2b860ac7335b9dba1731c2398ac3a2791521397ccc619ee0381edf705bb132ef"
42
+ }
43
+ },
44
+ "hash": "2b860ac7335b9dba1731c2398ac3a2791521397ccc619ee0381edf705bb132ef",
45
+ "ledger": 2626,
46
+ "envelope_xdr": "AAAAABB90WssODNIgi6BHveqzxTRmIpvAFRyVNM+Hm2GVuCcAAAAZAAABD0AAALWAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAq1899YsDJrBbFdeKl6iO2cJbKWPOwPj+MZaVZhSFznsAAAAXSHboAAAAAAAAAAABhlbgnAAAAEBJDTZxL0wLfR8Jn1DsY5mqUM+g0e6Va9LVSqcWMRBu3JXukA43VIBhMinuyFG3CJ9t82eWlOV8WqCyGZbKZLQM",
47
+ "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=",
48
+ "result_meta_xdr": "AAAAAQAAAAIAAAADAAAKQgAAAAAAAAAAEH3Rayw4M0iCLoEe96rPFNGYim8AVHJU0z4ebYZW4JwAA1UD3FScaAAABD0AAALVAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAKQgAAAAAAAAAAEH3Rayw4M0iCLoEe96rPFNGYim8AVHJU0z4ebYZW4JwAA1UD3FScaAAABD0AAALWAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAMAAApCAAAAAAAAAAAQfdFrLDgzSIIugR73qs8U0ZiKbwBUclTTPh5thlbgnAADVQPcVJxoAAAEPQAAAtYAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAApCAAAAAAAAAAAQfdFrLDgzSIIugR73qs8U0ZiKbwBUclTTPh5thlbgnAADVOyT3bRoAAAEPQAAAtYAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAApCAAAAAAAAAACrXz31iwMmsFsV14qXqI7ZwlspY87A+P4xlpVmFIXOewAAABdIdugAAAAKQgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA=="
49
+ }
50
+ http_version:
51
+ recorded_at: Wed, 27 Feb 2019 13:37:42 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://horizon-testnet.stellar.org/
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
61
+ Accept:
62
+ - application/hal+json,application/problem+json,application/json
63
+ response:
64
+ status:
65
+ code: 200
66
+ message: OK
67
+ headers:
68
+ Cache-Control:
69
+ - no-cache, no-store, max-age=0
70
+ Content-Disposition:
71
+ - inline
72
+ Content-Type:
73
+ - application/hal+json; charset=utf-8
74
+ Date:
75
+ - Wed, 27 Feb 2019 13:37:44 GMT
76
+ Vary:
77
+ - Origin
78
+ X-Ratelimit-Limit:
79
+ - '101'
80
+ X-Ratelimit-Remaining:
81
+ - '100'
82
+ X-Ratelimit-Reset:
83
+ - '1'
84
+ Content-Length:
85
+ - '1615'
86
+ Connection:
87
+ - keep-alive
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: |-
91
+ {
92
+ "_links": {
93
+ "account": {
94
+ "href": "https://horizon-testnet.stellar.org/accounts/{account_id}",
95
+ "templated": true
96
+ },
97
+ "account_transactions": {
98
+ "href": "https://horizon-testnet.stellar.org/accounts/{account_id}/transactions{?cursor,limit,order}",
99
+ "templated": true
100
+ },
101
+ "assets": {
102
+ "href": "https://horizon-testnet.stellar.org/assets{?asset_code,asset_issuer,cursor,limit,order}",
103
+ "templated": true
104
+ },
105
+ "friendbot": {
106
+ "href": "https://friendbot.stellar.org/{?addr}",
107
+ "templated": true
108
+ },
109
+ "metrics": {
110
+ "href": "https://horizon-testnet.stellar.org/metrics"
111
+ },
112
+ "order_book": {
113
+ "href": "https://horizon-testnet.stellar.org/order_book{?selling_asset_type,selling_asset_code,selling_asset_issuer,buying_asset_type,buying_asset_code,buying_asset_issuer,limit}",
114
+ "templated": true
115
+ },
116
+ "self": {
117
+ "href": "https://horizon-testnet.stellar.org/"
118
+ },
119
+ "transaction": {
120
+ "href": "https://horizon-testnet.stellar.org/transactions/{hash}",
121
+ "templated": true
122
+ },
123
+ "transactions": {
124
+ "href": "https://horizon-testnet.stellar.org/transactions{?cursor,limit,order}",
125
+ "templated": true
126
+ }
127
+ },
128
+ "horizon_version": "0.17.0-f510ce5a0450f1fab1576f248a8a9f7a9ec3aaf7",
129
+ "core_version": "stellar-core 10.2.0 (54504c714ab6e696283e0bd0fdf1c3a029b7c88b)",
130
+ "history_latest_ledger": 2626,
131
+ "history_elder_ledger": 1,
132
+ "core_latest_ledger": 2626,
133
+ "network_passphrase": "Test SDF Network ; September 2015",
134
+ "current_protocol_version": 10,
135
+ "core_supported_protocol_version": 10
136
+ }
137
+ http_version:
138
+ recorded_at: Wed, 27 Feb 2019 13:37:44 GMT
139
+ - request:
140
+ method: get
141
+ uri: https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7
142
+ body:
143
+ encoding: US-ASCII
144
+ string: ''
145
+ headers:
146
+ User-Agent:
147
+ - Faraday v0.15.4
148
+ Accept:
149
+ - application/hal+json,application/problem+json,application/json
150
+ response:
151
+ status:
152
+ code: 200
153
+ message: OK
154
+ headers:
155
+ Cache-Control:
156
+ - no-cache, no-store, max-age=0
157
+ Content-Disposition:
158
+ - inline
159
+ Content-Type:
160
+ - application/hal+json; charset=utf-8
161
+ Date:
162
+ - Wed, 27 Feb 2019 13:37:45 GMT
163
+ Vary:
164
+ - Origin
165
+ X-Ratelimit-Limit:
166
+ - '101'
167
+ X-Ratelimit-Remaining:
168
+ - '100'
169
+ X-Ratelimit-Reset:
170
+ - '1'
171
+ Content-Length:
172
+ - '2295'
173
+ Connection:
174
+ - keep-alive
175
+ body:
176
+ encoding: ASCII-8BIT
177
+ string: |-
178
+ {
179
+ "_links": {
180
+ "self": {
181
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7"
182
+ },
183
+ "transactions": {
184
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/transactions{?cursor,limit,order}",
185
+ "templated": true
186
+ },
187
+ "operations": {
188
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/operations{?cursor,limit,order}",
189
+ "templated": true
190
+ },
191
+ "payments": {
192
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/payments{?cursor,limit,order}",
193
+ "templated": true
194
+ },
195
+ "effects": {
196
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/effects{?cursor,limit,order}",
197
+ "templated": true
198
+ },
199
+ "offers": {
200
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/offers{?cursor,limit,order}",
201
+ "templated": true
202
+ },
203
+ "trades": {
204
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/trades{?cursor,limit,order}",
205
+ "templated": true
206
+ },
207
+ "data": {
208
+ "href": "https://horizon-testnet.stellar.org/accounts/GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7/data/{key}",
209
+ "templated": true
210
+ }
211
+ },
212
+ "id": "GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7",
213
+ "paging_token": "",
214
+ "account_id": "GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7",
215
+ "sequence": "11278584119296",
216
+ "subentry_count": 0,
217
+ "thresholds": {
218
+ "low_threshold": 0,
219
+ "med_threshold": 0,
220
+ "high_threshold": 0
221
+ },
222
+ "flags": {
223
+ "auth_required": false,
224
+ "auth_revocable": false,
225
+ "auth_immutable": false
226
+ },
227
+ "balances": [
228
+ {
229
+ "balance": "10000.0000000",
230
+ "buying_liabilities": "0.0000000",
231
+ "selling_liabilities": "0.0000000",
232
+ "asset_type": "native"
233
+ }
234
+ ],
235
+ "signers": [
236
+ {
237
+ "weight": 1,
238
+ "key": "GCVV6PPVRMBSNMC3CXLYVF5IR3M4EWZJMPHMB6H6GGLJKZQUQXHHWLH7",
239
+ "type": "ed25519_public_key"
240
+ }
241
+ ],
242
+ "data": {}
243
+ }
244
+ http_version:
245
+ recorded_at: Wed, 27 Feb 2019 13:37:45 GMT
246
+ recorded_with: VCR 3.0.3
@@ -33,6 +33,27 @@ describe Stellar::Client do
33
33
  end
34
34
  end
35
35
 
36
+ describe "#friendbot" do
37
+ let(:client) { Stellar::Client.default_testnet }
38
+ let(:account) { Stellar::Account.random }
39
+
40
+ it("requests for XLM from a friendbot", {
41
+ vcr: {record: :once, match_requests_on: [:method]}
42
+ }) do
43
+ response = client.friendbot(account)
44
+
45
+ expect(response).to be_success
46
+
47
+ destination_info = client.account_info(account)
48
+ balances = destination_info.balances
49
+ expect(balances).to_not be_empty
50
+ native_asset_balance_info = balances.find do |b|
51
+ b["asset_type"] == "native"
52
+ end
53
+ expect(native_asset_balance_info["balance"].to_f).to be > 0
54
+ end
55
+ end
56
+
36
57
  describe "#create_account" do
37
58
  let(:source) { Stellar::Account.from_seed(CONFIG[:source_seed]) }
38
59
  let(:destination) { Stellar::Account.random }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Fleckenstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-29 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stellar-base
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 5.2.0
81
+ version: '5.0'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 5.2.0
88
+ version: '5.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: toml-rb
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -112,14 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '1.16'
115
+ version: '2.0'
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '1.16'
122
+ version: '2.0'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: rake
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -225,6 +225,7 @@ executables: []
225
225
  extensions: []
226
226
  extra_rdoc_files: []
227
227
  files:
228
+ - ".github/CODEOWNERS"
228
229
  - ".gitignore"
229
230
  - ".travis.yml"
230
231
  - ".yardopts"
@@ -257,6 +258,7 @@ files:
257
258
  - spec/fixtures/vcr_cassettes/Stellar_Client/_account_merge/merges_source_account_into_destination.yml
258
259
  - spec/fixtures/vcr_cassettes/Stellar_Client/_change_trust/given_an_asset_described_as_an_array/creates_updates_or_deletes_a_trustline.yml
259
260
  - spec/fixtures/vcr_cassettes/Stellar_Client/_create_account/creates_the_account.yml
261
+ - spec/fixtures/vcr_cassettes/Stellar_Client/_friendbot/requests_for_XLM_from_a_friendbot.yml
260
262
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/alphanum12_asset/sends_a_alphanum12_asset_to_the_destination.yml
261
263
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/alphanum4_asset/sends_a_alphanum4_asset_to_the_destination.yml
262
264
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/memo/accepts_the_memo_attribute.yml
@@ -275,7 +277,7 @@ files:
275
277
  - spec/support/vcr.rb
276
278
  - tasks/rspec.rake
277
279
  - tasks/travis.rake
278
- homepage: http://github.com/stellar/ruby-stellar-sdk
280
+ homepage: http://github.com/bloom-solutions/ruby-stellar-sdk
279
281
  licenses:
280
282
  - Apache 2.0
281
283
  metadata: {}
@@ -295,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
297
  version: '0'
296
298
  requirements: []
297
299
  rubyforge_project:
298
- rubygems_version: 2.5.1
300
+ rubygems_version: 2.7.8
299
301
  signing_key:
300
302
  specification_version: 4
301
303
  summary: Stellar client library
@@ -308,6 +310,7 @@ test_files:
308
310
  - spec/fixtures/vcr_cassettes/Stellar_Client/_account_merge/merges_source_account_into_destination.yml
309
311
  - spec/fixtures/vcr_cassettes/Stellar_Client/_change_trust/given_an_asset_described_as_an_array/creates_updates_or_deletes_a_trustline.yml
310
312
  - spec/fixtures/vcr_cassettes/Stellar_Client/_create_account/creates_the_account.yml
313
+ - spec/fixtures/vcr_cassettes/Stellar_Client/_friendbot/requests_for_XLM_from_a_friendbot.yml
311
314
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/alphanum12_asset/sends_a_alphanum12_asset_to_the_destination.yml
312
315
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/alphanum4_asset/sends_a_alphanum4_asset_to_the_destination.yml
313
316
  - spec/fixtures/vcr_cassettes/Stellar_Client/_send_payment/memo/accepts_the_memo_attribute.yml