stellar-sdk 0.4.0 → 0.5.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: f3c1d917a218343ba852380651053255ddc4aa0293d96cfee5ef4856d5aa9fe2
4
- data.tar.gz: 69f8d0f5e220140e02527ff284877a424c284065e3f397a88f28221d2c73af69
3
+ metadata.gz: 545e59b76cae8e040a4ac6041bc6ab576e82ea94d64333eee7033c669af3ccfa
4
+ data.tar.gz: a91fa43b9bcd8692d4a98868803ede802f5316bf97cc7aaf30352540c8c6d424
5
5
  SHA512:
6
- metadata.gz: e4cb249129ec6e825c83d54a095e255f27e91ef7d3202efd66bceab1fd6fb06095feb82b6a1f5f56210c7c87e6db0a2e030dd285364152ea904c65c95cb46fd1
7
- data.tar.gz: 5e0a36fdd2c0de489a39d8582d54f4495db4dbbaf8079c6656d1e96bac19fac3febc08eb19566f75d12c38b4929f2d76e196a374499bc89246c36a84df43d7c3
6
+ metadata.gz: 48d8edceac23d22aca3a678ef58ee272cd76bea945491008ecdcaf40cbce79d6cd49afbb59fdccc64e99474fbb23799f79a2ac84c738645d1873814346797df3
7
+ data.tar.gz: d3ba53f2235a3f2e8f511d3b947037d46b366f5c690d42fbf0d7b1578c47be81bd95c510f55293198d2a2e4e33ad920fa9bd967baf70157063c05bf4d0b9b18c
@@ -11,3 +11,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11
11
  ### Fixed
12
12
  - `#create_account`, along with `#send_payment`
13
13
 
14
+ ### Added
15
+ - `Stellar::Client#change_trust` to create, update, delete a trustline
@@ -1,12 +1 @@
1
- require 'stellar-sdk'
2
-
3
- account = Stellar::Account.from_seed("SBXH4SEH32PENMMB66P4TY6LXUIFMRVFUMX2LJC3P2STHICBJLNQJOH5")
4
- client = Stellar::Client.default_testnet()
5
-
6
- issuer = Stellar::Account.lookup("tips*stellarid.io")
7
- asset = Stellar::Asset.alphanum4("USD", issuer)
8
-
9
- client.trust({
10
- account: account,
11
- asset: asset
12
- })
1
+ # See the spec for `#change_trust` in `spec/lib/stellar/client_spec.rb`
@@ -3,24 +3,31 @@ require 'hyperclient'
3
3
  module Stellar
4
4
  class Client
5
5
  include Contracts
6
+ C = Contracts
7
+
8
+ DEFAULT_FEE = 100
9
+
10
+ HORIZON_LOCALHOST_URL = 'http://127.0.0.1:8000'
11
+ HORIZON_MAINNET_URL = 'https://horizon.stellar.org'
12
+ HORIZON_TESTNET_URL = 'https://horizon-testnet.stellar.org'
6
13
 
7
14
  def self.default(options={})
8
- new options.merge({
9
- horizon: "https://horizon.stellar.org"
10
- })
15
+ new options.merge(
16
+ horizon: HORIZON_MAINNET_URL
17
+ )
11
18
  end
12
19
 
13
20
  def self.default_testnet(options={})
14
- new options.merge({
15
- horizon: "https://horizon-testnet.stellar.org",
16
- friendbot: "https://horizon-testnet.stellar.org",
17
- })
21
+ new options.merge(
22
+ horizon: HORIZON_TESTNET_URL,
23
+ friendbot: HORIZON_TESTNET_URL,
24
+ )
18
25
  end
19
26
 
20
27
  def self.localhost(options={})
21
- new options.merge({
22
- horizon: "http://127.0.0.1:8000"
23
- })
28
+ new options.merge(
29
+ horizon: HORIZON_LOCALHOST_URL
30
+ )
24
31
  end
25
32
 
26
33
  attr_reader :horizon
@@ -42,10 +49,6 @@ module Stellar
42
49
  end
43
50
  end
44
51
 
45
- def friendbot(account)
46
- raise NotImplementedError
47
- end
48
-
49
52
  Contract Stellar::Account => Any
50
53
  def account_info(account)
51
54
  account_id = account.address
@@ -53,25 +56,28 @@ module Stellar
53
56
  end
54
57
 
55
58
  Contract ({
56
- from: Stellar::Account,
57
- to: Stellar::Account,
58
- amount: Stellar::Amount
59
+ account: Stellar::Account,
60
+ destination: Stellar::Account
59
61
  }) => Any
60
- def send_payment(options={})
61
- from = options[:from]
62
- sequence = options[:sequence] || (account_info(from).sequence.to_i + 1)
63
-
64
- payment = Stellar::Transaction.payment({
65
- account: from.keypair,
66
- destination: options[:to].keypair,
67
- sequence: sequence,
68
- amount: options[:amount].to_payment,
62
+ def account_merge(options={})
63
+ account = options[:account]
64
+ destination = options[:destination]
65
+ sequence = options[:sequence] || (account_info(account).sequence.to_i + 1)
66
+
67
+ transaction = Stellar::Transaction.account_merge({
68
+ account: account.keypair,
69
+ destination: destination.keypair,
70
+ sequence: sequence
69
71
  })
70
72
 
71
- envelope_base64 = payment.to_envelope(from.keypair).to_xdr(:base64)
73
+ envelope_base64 = transaction.to_envelope(account.keypair).to_xdr(:base64)
72
74
  @horizon.transactions._post(tx: envelope_base64)
73
75
  end
74
76
 
77
+ def friendbot(account)
78
+ raise NotImplementedError
79
+ end
80
+
75
81
  Contract ({
76
82
  account: Stellar::Account,
77
83
  funder: Stellar::Account,
@@ -82,7 +88,7 @@ module Stellar
82
88
  sequence = options[:sequence] || (account_info(funder).sequence.to_i + 1)
83
89
  # In the future, the fee should be grabbed from the network's last transactions,
84
90
  # instead of using a hard-coded default value.
85
- fee = options[:fee] || 100
91
+ fee = options[:fee] || DEFAULT_FEE
86
92
 
87
93
  payment = Stellar::Transaction.create_account({
88
94
  account: funder.keypair,
@@ -96,6 +102,26 @@ module Stellar
96
102
  @horizon.transactions._post(tx: envelope_base64)
97
103
  end
98
104
 
105
+ Contract ({
106
+ from: Stellar::Account,
107
+ to: Stellar::Account,
108
+ amount: Stellar::Amount
109
+ }) => Any
110
+ def send_payment(options={})
111
+ from = options[:from]
112
+ sequence = options[:sequence] || (account_info(from).sequence.to_i + 1)
113
+
114
+ payment = Stellar::Transaction.payment({
115
+ account: from.keypair,
116
+ destination: options[:to].keypair,
117
+ sequence: sequence,
118
+ amount: options[:amount].to_payment,
119
+ })
120
+
121
+ envelope_base64 = payment.to_envelope(from.keypair).to_xdr(:base64)
122
+ @horizon.transactions._post(tx: envelope_base64)
123
+ end
124
+
99
125
  Contract ({
100
126
  account: Maybe[Stellar::Account],
101
127
  limit: Maybe[Pos],
@@ -114,5 +140,34 @@ module Stellar
114
140
  TransactionPage.new(resource)
115
141
  end
116
142
 
143
+ Contract(C::KeywordArgs[
144
+ asset: [Symbol, String, Xor[Stellar::KeyPair, Stellar::Account]],
145
+ source: Stellar::Account,
146
+ sequence: Maybe[Integer],
147
+ fee: Maybe[Integer],
148
+ limit: Maybe[Integer],
149
+ ] => Any)
150
+ def change_trust(
151
+ asset:,
152
+ source:,
153
+ sequence: nil,
154
+ fee: DEFAULT_FEE,
155
+ limit: nil
156
+ )
157
+ sequence ||= (account_info(source).sequence.to_i + 1)
158
+
159
+ args = {
160
+ account: source.keypair,
161
+ sequence: sequence,
162
+ line: asset,
163
+ }
164
+ args[:limit] = limit if !limit.nil?
165
+
166
+ tx = Stellar::Transaction.change_trust(args)
167
+
168
+ envelope_base64 = tx.to_envelope(source.keypair).to_xdr(:base64)
169
+ horizon.transactions._post(tx: envelope_base64)
170
+ end
171
+
117
172
  end
118
173
  end
@@ -1,3 +1,3 @@
1
1
  module Stellar
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -17,11 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "stellar-base", "~> 0.13"
20
+ spec.add_dependency "stellar-base", ">= 0.16.0"
21
21
  spec.add_dependency "hyperclient", "~> 0.7"
22
22
  spec.add_dependency "excon", "~> 0.44", ">= 0.44.4"
23
- spec.add_dependency "contracts", "~> 0.7"
24
- spec.add_dependency "activesupport", ">= 4.2.7"
23
+ spec.add_dependency "contracts", "~> 0.16"
24
+ spec.add_dependency "activesupport", ">= 5.2.0"
25
25
  spec.add_dependency "toml-rb", "~> 1.1", ">= 1.1.1"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.16"
@@ -1,10 +1,7 @@
1
1
  ---
2
- # Source must be funded already. It is also used as an issuer of BTC
3
- source_seed: "SABJWDUVR2AHZEJ6FSVTHAPDHMR3K7A6VP3APHFHRJTUXEHMDS6AL3VY"
4
- source_address: "GCQSESW66AX4ZRZB7QWCIXSPX2BD7KLOYSS33IUGDCLO4XCPURZEEC6R"
5
-
6
- # Destination is used to test sending of assets. Until this gem supports
7
- # creating trustlines, we have to do this. The following account must trust the
8
- # source's BTC asset
9
- destination_seed: "SCPIADRAFSPKE5KEUZ6BKXSMRFFSO7UCSTRKALT23U3DVQ3WWNTPA44Z"
10
- destination_address: "GCQSESW66AX4ZRZB7QWCIXSPX2BD7KLOYSS33IUGDCLO4XCPURZEEC6R"
2
+ # Source must be funded already
3
+ # Use https://www.stellar.org/laboratory/#account-creator?network=test
4
+ # These ones in the sample are just randomly generated ones; enough for tests
5
+ # to pass (as long as we're not re-recording)
6
+ source_seed: "SALQBNNRCXWD32E4QKIXKXCMXCPJKWUP34EAK53SP6PNGAUVWSAM5IUQ"
7
+ source_address: "GCIDYJRG5HV4WEESRA4LEKIMXLCU46XIKXGZK4PWX5K23PJIATMWR3UE"
@@ -0,0 +1,714 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://horizon-testnet.stellar.org/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.2
12
+ Accept:
13
+ - application/hal+json,application/problem+json,application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Tue, 05 Jun 2018 15:15:40 GMT
21
+ Content-Type:
22
+ - application/hal+json; charset=utf-8
23
+ Connection:
24
+ - keep-alive
25
+ Set-Cookie:
26
+ - __cfduid=df7542c54abeae62e4734685444e4351b1528211740; expires=Wed, 05-Jun-19
27
+ 15:15:40 GMT; path=/; domain=.stellar.org; HttpOnly
28
+ Content-Disposition:
29
+ - inline
30
+ Vary:
31
+ - Origin
32
+ X-Ratelimit-Limit:
33
+ - '17200'
34
+ X-Ratelimit-Remaining:
35
+ - '17179'
36
+ X-Ratelimit-Reset:
37
+ - '3183'
38
+ Expect-Ct:
39
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
40
+ Server:
41
+ - cloudflare
42
+ Cf-Ray:
43
+ - 4263988f5bafb8d7-MIA
44
+ body:
45
+ encoding: ASCII-8BIT
46
+ string: |-
47
+ {
48
+ "_links": {
49
+ "account": {
50
+ "href": "https://horizon-testnet.stellar.org/accounts/{account_id}",
51
+ "templated": true
52
+ },
53
+ "account_transactions": {
54
+ "href": "https://horizon-testnet.stellar.org/accounts/{account_id}/transactions{?cursor,limit,order}",
55
+ "templated": true
56
+ },
57
+ "assets": {
58
+ "href": "https://horizon-testnet.stellar.org/assets{?asset_code,asset_issuer,cursor,limit,order}",
59
+ "templated": true
60
+ },
61
+ "friendbot": {
62
+ "href": "https://horizon-testnet.stellar.org/friendbot{?addr}",
63
+ "templated": true
64
+ },
65
+ "metrics": {
66
+ "href": "https://horizon-testnet.stellar.org/metrics"
67
+ },
68
+ "order_book": {
69
+ "href": "https://horizon-testnet.stellar.org/order_book{?selling_asset_type,selling_asset_code,selling_issuer,buying_asset_type,buying_asset_code,buying_issuer,limit}",
70
+ "templated": true
71
+ },
72
+ "self": {
73
+ "href": "https://horizon-testnet.stellar.org/"
74
+ },
75
+ "transaction": {
76
+ "href": "https://horizon-testnet.stellar.org/transactions/{hash}",
77
+ "templated": true
78
+ },
79
+ "transactions": {
80
+ "href": "https://horizon-testnet.stellar.org/transactions{?cursor,limit,order}",
81
+ "templated": true
82
+ }
83
+ },
84
+ "horizon_version": "snapshot-1bf713b",
85
+ "core_version": "stellar-core 9.2.0rc6 (b0923f153b86d394a83b2a619db6b23f07ed0700)",
86
+ "history_latest_ledger": 9341700,
87
+ "history_elder_ledger": 1,
88
+ "core_latest_ledger": 9341700,
89
+ "network_passphrase": "Test SDF Network ; September 2015",
90
+ "protocol_version": 9
91
+ }
92
+ http_version:
93
+ recorded_at: Tue, 05 Jun 2018 15:15:37 GMT
94
+ - request:
95
+ method: get
96
+ uri: https://horizon-testnet.stellar.org/accounts/[source_address]
97
+ body:
98
+ encoding: US-ASCII
99
+ string: ''
100
+ headers:
101
+ User-Agent:
102
+ - Faraday v0.15.2
103
+ Accept:
104
+ - application/hal+json,application/problem+json,application/json
105
+ response:
106
+ status:
107
+ code: 200
108
+ message: OK
109
+ headers:
110
+ Date:
111
+ - Tue, 05 Jun 2018 15:15:41 GMT
112
+ Content-Type:
113
+ - application/hal+json; charset=utf-8
114
+ Connection:
115
+ - keep-alive
116
+ Set-Cookie:
117
+ - __cfduid=dd99075ddf2370fc0f834fb9df697bf721528211741; expires=Wed, 05-Jun-19
118
+ 15:15:41 GMT; path=/; domain=.stellar.org; HttpOnly
119
+ Content-Disposition:
120
+ - inline
121
+ Vary:
122
+ - Origin
123
+ X-Ratelimit-Limit:
124
+ - '17200'
125
+ X-Ratelimit-Remaining:
126
+ - '17178'
127
+ X-Ratelimit-Reset:
128
+ - '3182'
129
+ Expect-Ct:
130
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
131
+ Server:
132
+ - cloudflare
133
+ Cf-Ray:
134
+ - 426398962dbab8ef-MIA
135
+ body:
136
+ encoding: ASCII-8BIT
137
+ string: |-
138
+ {
139
+ "_links": {
140
+ "self": {
141
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]"
142
+ },
143
+ "transactions": {
144
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/transactions{?cursor,limit,order}",
145
+ "templated": true
146
+ },
147
+ "operations": {
148
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/operations{?cursor,limit,order}",
149
+ "templated": true
150
+ },
151
+ "payments": {
152
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/payments{?cursor,limit,order}",
153
+ "templated": true
154
+ },
155
+ "effects": {
156
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/effects{?cursor,limit,order}",
157
+ "templated": true
158
+ },
159
+ "offers": {
160
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/offers{?cursor,limit,order}",
161
+ "templated": true
162
+ },
163
+ "trades": {
164
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/trades{?cursor,limit,order}",
165
+ "templated": true
166
+ },
167
+ "data": {
168
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/data/{key}",
169
+ "templated": true
170
+ }
171
+ },
172
+ "id": "[source_address]",
173
+ "paging_token": "",
174
+ "account_id": "[source_address]",
175
+ "sequence": "346973227974784",
176
+ "subentry_count": 0,
177
+ "thresholds": {
178
+ "low_threshold": 0,
179
+ "med_threshold": 0,
180
+ "high_threshold": 0
181
+ },
182
+ "flags": {
183
+ "auth_required": false,
184
+ "auth_revocable": false
185
+ },
186
+ "balances": [
187
+ {
188
+ "balance": "964.9990600",
189
+ "asset_type": "native"
190
+ }
191
+ ],
192
+ "signers": [
193
+ {
194
+ "public_key": "[source_address]",
195
+ "weight": 1,
196
+ "key": "[source_address]",
197
+ "type": "ed25519_public_key"
198
+ }
199
+ ],
200
+ "data": {}
201
+ }
202
+ http_version:
203
+ recorded_at: Tue, 05 Jun 2018 15:15:39 GMT
204
+ - request:
205
+ method: post
206
+ uri: https://horizon-testnet.stellar.org/transactions
207
+ body:
208
+ encoding: UTF-8
209
+ string: tx=AAAAAKEiSt7wL8zHIfwsJF5PvoI%2FqW7Epb2ihhiW7lxPpHJCAAAAZAABO5IAAACBAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA4BfMAardmRm9twywweWFzR2ynIW3T986u5CqHM0UiwUAAAAAO5rKAAAAAAAAAAABT6RyQgAAAEDyxggtxPkrRSmROhSHRcBXvTFCFpfq5OCYxwqjQB5uLhMdS3ZXqM%2FyTelODeJyM5qdzq40DDh4lYzCjxUzJ7UJ
210
+ headers:
211
+ User-Agent:
212
+ - Faraday v0.15.2
213
+ Accept:
214
+ - application/hal+json,application/problem+json,application/json
215
+ Content-Type:
216
+ - application/x-www-form-urlencoded
217
+ response:
218
+ status:
219
+ code: 200
220
+ message: OK
221
+ headers:
222
+ Date:
223
+ - Tue, 05 Jun 2018 15:15:46 GMT
224
+ Content-Type:
225
+ - application/hal+json; charset=utf-8
226
+ Connection:
227
+ - keep-alive
228
+ Set-Cookie:
229
+ - __cfduid=da455a131afd204c03db03b491318ac861528211742; expires=Wed, 05-Jun-19
230
+ 15:15:42 GMT; path=/; domain=.stellar.org; HttpOnly
231
+ Content-Disposition:
232
+ - inline
233
+ Vary:
234
+ - Origin
235
+ X-Ratelimit-Limit:
236
+ - '17200'
237
+ X-Ratelimit-Remaining:
238
+ - '17177'
239
+ X-Ratelimit-Reset:
240
+ - '3181'
241
+ Expect-Ct:
242
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
243
+ Server:
244
+ - cloudflare
245
+ Cf-Ray:
246
+ - 4263989bbde3b8d1-MIA
247
+ body:
248
+ encoding: ASCII-8BIT
249
+ string: |-
250
+ {
251
+ "_links": {
252
+ "transaction": {
253
+ "href": "https://horizon-testnet.stellar.org/transactions/3d1008c0c4ecc0835caf3d04bfb65432c6a578ccf0addb2eb16dd12be5d0dde2"
254
+ }
255
+ },
256
+ "hash": "3d1008c0c4ecc0835caf3d04bfb65432c6a578ccf0addb2eb16dd12be5d0dde2",
257
+ "ledger": 9341702,
258
+ "envelope_xdr": "AAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAZAABO5IAAACBAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA4BfMAardmRm9twywweWFzR2ynIW3T986u5CqHM0UiwUAAAAAO5rKAAAAAAAAAAABT6RyQgAAAEDyxggtxPkrRSmROhSHRcBXvTFCFpfq5OCYxwqjQB5uLhMdS3ZXqM/yTelODeJyM5qdzq40DDh4lYzCjxUzJ7UJ",
259
+ "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=",
260
+ "result_meta_xdr": "AAAAAAAAAAEAAAADAAAAAACOiwYAAAAAAAAAAOAXzAGq3ZkZvbcMsMHlhc0dspyFt0/fOruQqhzNFIsFAAAAADuaygAAjosGAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAwCOiwYAAAAAAAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAAj8vK2QAATuSAAAAgQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQCOiwYAAAAAAAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAAgOUYWQAATuSAAAAgQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA"
261
+ }
262
+ http_version:
263
+ recorded_at: Tue, 05 Jun 2018 15:15:44 GMT
264
+ - request:
265
+ method: get
266
+ uri: https://horizon-testnet.stellar.org/accounts/[source_address]
267
+ body:
268
+ encoding: US-ASCII
269
+ string: ''
270
+ headers:
271
+ User-Agent:
272
+ - Faraday v0.15.2
273
+ Accept:
274
+ - application/hal+json,application/problem+json,application/json
275
+ response:
276
+ status:
277
+ code: 200
278
+ message: OK
279
+ headers:
280
+ Date:
281
+ - Tue, 05 Jun 2018 15:15:48 GMT
282
+ Content-Type:
283
+ - application/hal+json; charset=utf-8
284
+ Connection:
285
+ - keep-alive
286
+ Set-Cookie:
287
+ - __cfduid=d38d1bff1902f202e8b3360063a4ad4a01528211748; expires=Wed, 05-Jun-19
288
+ 15:15:48 GMT; path=/; domain=.stellar.org; HttpOnly
289
+ Content-Disposition:
290
+ - inline
291
+ Vary:
292
+ - Origin
293
+ X-Ratelimit-Limit:
294
+ - '17200'
295
+ X-Ratelimit-Remaining:
296
+ - '17176'
297
+ X-Ratelimit-Reset:
298
+ - '3175'
299
+ Expect-Ct:
300
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
301
+ Server:
302
+ - cloudflare
303
+ Cf-Ray:
304
+ - 426398c23a12b901-MIA
305
+ body:
306
+ encoding: ASCII-8BIT
307
+ string: |-
308
+ {
309
+ "_links": {
310
+ "self": {
311
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]"
312
+ },
313
+ "transactions": {
314
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/transactions{?cursor,limit,order}",
315
+ "templated": true
316
+ },
317
+ "operations": {
318
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/operations{?cursor,limit,order}",
319
+ "templated": true
320
+ },
321
+ "payments": {
322
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/payments{?cursor,limit,order}",
323
+ "templated": true
324
+ },
325
+ "effects": {
326
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/effects{?cursor,limit,order}",
327
+ "templated": true
328
+ },
329
+ "offers": {
330
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/offers{?cursor,limit,order}",
331
+ "templated": true
332
+ },
333
+ "trades": {
334
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/trades{?cursor,limit,order}",
335
+ "templated": true
336
+ },
337
+ "data": {
338
+ "href": "https://horizon-testnet.stellar.org/accounts/[source_address]/data/{key}",
339
+ "templated": true
340
+ }
341
+ },
342
+ "id": "[source_address]",
343
+ "paging_token": "",
344
+ "account_id": "[source_address]",
345
+ "sequence": "346973227974785",
346
+ "subentry_count": 0,
347
+ "thresholds": {
348
+ "low_threshold": 0,
349
+ "med_threshold": 0,
350
+ "high_threshold": 0
351
+ },
352
+ "flags": {
353
+ "auth_required": false,
354
+ "auth_revocable": false
355
+ },
356
+ "balances": [
357
+ {
358
+ "balance": "864.9990500",
359
+ "asset_type": "native"
360
+ }
361
+ ],
362
+ "signers": [
363
+ {
364
+ "public_key": "[source_address]",
365
+ "weight": 1,
366
+ "key": "[source_address]",
367
+ "type": "ed25519_public_key"
368
+ }
369
+ ],
370
+ "data": {}
371
+ }
372
+ http_version:
373
+ recorded_at: Tue, 05 Jun 2018 15:15:45 GMT
374
+ - request:
375
+ method: post
376
+ uri: https://horizon-testnet.stellar.org/transactions
377
+ body:
378
+ encoding: UTF-8
379
+ string: tx=AAAAAKEiSt7wL8zHIfwsJF5PvoI%2FqW7Epb2ihhiW7lxPpHJCAAAAZAABO5IAAACCAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAgDhX5rMlWCiVeS9ZCdzvl8l%2FIFpze3C9P5Tk7Qxk6xwAAAAAO5rKAAAAAAAAAAABT6RyQgAAAEAnn8nAhSA7dLMKwKSgYVPqeqk0zl7bzFA78haAYNaSL5GHKeu9iMkqOPQcpHRWeCV4GK63%2B9d3pr0SzD%2F9AZgE
380
+ headers:
381
+ User-Agent:
382
+ - Faraday v0.15.2
383
+ Accept:
384
+ - application/hal+json,application/problem+json,application/json
385
+ Content-Type:
386
+ - application/x-www-form-urlencoded
387
+ response:
388
+ status:
389
+ code: 200
390
+ message: OK
391
+ headers:
392
+ Date:
393
+ - Tue, 05 Jun 2018 15:15:51 GMT
394
+ Content-Type:
395
+ - application/hal+json; charset=utf-8
396
+ Connection:
397
+ - keep-alive
398
+ Set-Cookie:
399
+ - __cfduid=d0f5879a2d370a2ecdf80dfe0557ae5571528211748; expires=Wed, 05-Jun-19
400
+ 15:15:48 GMT; path=/; domain=.stellar.org; HttpOnly
401
+ Content-Disposition:
402
+ - inline
403
+ Vary:
404
+ - Origin
405
+ X-Ratelimit-Limit:
406
+ - '17200'
407
+ X-Ratelimit-Remaining:
408
+ - '17175'
409
+ X-Ratelimit-Reset:
410
+ - '3175'
411
+ Expect-Ct:
412
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
413
+ Server:
414
+ - cloudflare
415
+ Cf-Ray:
416
+ - 426398c2fef9b8b3-MIA
417
+ body:
418
+ encoding: ASCII-8BIT
419
+ string: |-
420
+ {
421
+ "_links": {
422
+ "transaction": {
423
+ "href": "https://horizon-testnet.stellar.org/transactions/830b5490a744c0635e96add728a823c0947a458af98ea5e49f232adb38158a3f"
424
+ }
425
+ },
426
+ "hash": "830b5490a744c0635e96add728a823c0947a458af98ea5e49f232adb38158a3f",
427
+ "ledger": 9341703,
428
+ "envelope_xdr": "AAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAZAABO5IAAACCAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAgDhX5rMlWCiVeS9ZCdzvl8l/IFpze3C9P5Tk7Qxk6xwAAAAAO5rKAAAAAAAAAAABT6RyQgAAAEAnn8nAhSA7dLMKwKSgYVPqeqk0zl7bzFA78haAYNaSL5GHKeu9iMkqOPQcpHRWeCV4GK63+9d3pr0SzD/9AZgE",
429
+ "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=",
430
+ "result_meta_xdr": "AAAAAAAAAAEAAAADAAAAAACOiwcAAAAAAAAAAIA4V+azJVgolXkvWQnc75fJfyBac3twvT+U5O0MZOscAAAAADuaygAAjosHAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAwCOiwcAAAAAAAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAAgOUYQAAATuSAAAAggAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQCOiwcAAAAAAAAAAKEiSt7wL8zHIfwsJF5PvoI/qW7Epb2ihhiW7lxPpHJCAAAAAcf5lwAAATuSAAAAggAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA"
431
+ }
432
+ http_version:
433
+ recorded_at: Tue, 05 Jun 2018 15:15:49 GMT
434
+ - request:
435
+ method: get
436
+ uri: https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P
437
+ body:
438
+ encoding: US-ASCII
439
+ string: ''
440
+ headers:
441
+ User-Agent:
442
+ - Faraday v0.15.2
443
+ Accept:
444
+ - application/hal+json,application/problem+json,application/json
445
+ response:
446
+ status:
447
+ code: 200
448
+ message: OK
449
+ headers:
450
+ Date:
451
+ - Tue, 05 Jun 2018 15:15:52 GMT
452
+ Content-Type:
453
+ - application/hal+json; charset=utf-8
454
+ Connection:
455
+ - keep-alive
456
+ Set-Cookie:
457
+ - __cfduid=db441c58d35bd53ab812c41869fe0f3c41528211752; expires=Wed, 05-Jun-19
458
+ 15:15:52 GMT; path=/; domain=.stellar.org; HttpOnly
459
+ Content-Disposition:
460
+ - inline
461
+ Vary:
462
+ - Origin
463
+ X-Ratelimit-Limit:
464
+ - '17200'
465
+ X-Ratelimit-Remaining:
466
+ - '17175'
467
+ X-Ratelimit-Reset:
468
+ - '3036'
469
+ Expect-Ct:
470
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
471
+ Server:
472
+ - cloudflare
473
+ Cf-Ray:
474
+ - 426398db3e6bb8d7-MIA
475
+ body:
476
+ encoding: ASCII-8BIT
477
+ string: |-
478
+ {
479
+ "_links": {
480
+ "self": {
481
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P"
482
+ },
483
+ "transactions": {
484
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/transactions{?cursor,limit,order}",
485
+ "templated": true
486
+ },
487
+ "operations": {
488
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/operations{?cursor,limit,order}",
489
+ "templated": true
490
+ },
491
+ "payments": {
492
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/payments{?cursor,limit,order}",
493
+ "templated": true
494
+ },
495
+ "effects": {
496
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/effects{?cursor,limit,order}",
497
+ "templated": true
498
+ },
499
+ "offers": {
500
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/offers{?cursor,limit,order}",
501
+ "templated": true
502
+ },
503
+ "trades": {
504
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/trades{?cursor,limit,order}",
505
+ "templated": true
506
+ },
507
+ "data": {
508
+ "href": "https://horizon-testnet.stellar.org/accounts/GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P/data/{key}",
509
+ "templated": true
510
+ }
511
+ },
512
+ "id": "GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P",
513
+ "paging_token": "",
514
+ "account_id": "GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P",
515
+ "sequence": "40122304578977792",
516
+ "subentry_count": 0,
517
+ "thresholds": {
518
+ "low_threshold": 0,
519
+ "med_threshold": 0,
520
+ "high_threshold": 0
521
+ },
522
+ "flags": {
523
+ "auth_required": false,
524
+ "auth_revocable": false
525
+ },
526
+ "balances": [
527
+ {
528
+ "balance": "100.0000000",
529
+ "asset_type": "native"
530
+ }
531
+ ],
532
+ "signers": [
533
+ {
534
+ "public_key": "GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P",
535
+ "weight": 1,
536
+ "key": "GDQBPTABVLOZSGN5W4GLBQPFQXGR3MU4QW3U7XZ2XOIKUHGNCSFQLA5P",
537
+ "type": "ed25519_public_key"
538
+ }
539
+ ],
540
+ "data": {}
541
+ }
542
+ http_version:
543
+ recorded_at: Tue, 05 Jun 2018 15:15:50 GMT
544
+ - request:
545
+ method: post
546
+ uri: https://horizon-testnet.stellar.org/transactions
547
+ body:
548
+ encoding: UTF-8
549
+ string: tx=AAAAAOAXzAGq3ZkZvbcMsMHlhc0dspyFt0%2FfOruQqhzNFIsFAAAAZACOiwYAAAABAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAgDhX5rMlWCiVeS9ZCdzvl8l%2FIFpze3C9P5Tk7Qxk6xwAAAAAAAAAAc0UiwUAAABAgiJTFPxbt3ZhVf0OWdDcqI1pFGdfaSNFivt99Kop6pU6UWEY%2Fh0m7%2BKrp9vk4kuin13sLUkWKwCfZ3hJvxvLBA%3D%3D
550
+ headers:
551
+ User-Agent:
552
+ - Faraday v0.15.2
553
+ Accept:
554
+ - application/hal+json,application/problem+json,application/json
555
+ Content-Type:
556
+ - application/x-www-form-urlencoded
557
+ response:
558
+ status:
559
+ code: 200
560
+ message: OK
561
+ headers:
562
+ Date:
563
+ - Tue, 05 Jun 2018 15:15:56 GMT
564
+ Content-Type:
565
+ - application/hal+json; charset=utf-8
566
+ Connection:
567
+ - keep-alive
568
+ Set-Cookie:
569
+ - __cfduid=df3ed88d7becb796ec5cbcb63aa61cda31528211752; expires=Wed, 05-Jun-19
570
+ 15:15:52 GMT; path=/; domain=.stellar.org; HttpOnly
571
+ Content-Disposition:
572
+ - inline
573
+ Vary:
574
+ - Origin
575
+ X-Ratelimit-Limit:
576
+ - '17200'
577
+ X-Ratelimit-Remaining:
578
+ - '17174'
579
+ X-Ratelimit-Reset:
580
+ - '3171'
581
+ Expect-Ct:
582
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
583
+ Server:
584
+ - cloudflare
585
+ Cf-Ray:
586
+ - 426398dd3ee5b97f-MIA
587
+ body:
588
+ encoding: ASCII-8BIT
589
+ string: |-
590
+ {
591
+ "_links": {
592
+ "transaction": {
593
+ "href": "https://horizon-testnet.stellar.org/transactions/b24391adc2a582b859416a4b6b3ad5f3e4f96e7dd18246f7b56796627aa280d9"
594
+ }
595
+ },
596
+ "hash": "b24391adc2a582b859416a4b6b3ad5f3e4f96e7dd18246f7b56796627aa280d9",
597
+ "ledger": 9341704,
598
+ "envelope_xdr": "AAAAAOAXzAGq3ZkZvbcMsMHlhc0dspyFt0/fOruQqhzNFIsFAAAAZACOiwYAAAABAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAgDhX5rMlWCiVeS9ZCdzvl8l/IFpze3C9P5Tk7Qxk6xwAAAAAAAAAAc0UiwUAAABAgiJTFPxbt3ZhVf0OWdDcqI1pFGdfaSNFivt99Kop6pU6UWEY/h0m7+Krp9vk4kuin13sLUkWKwCfZ3hJvxvLBA==",
599
+ "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAIAAAAAAAAAAA7msmcAAAAAA==",
600
+ "result_meta_xdr": "AAAAAAAAAAEAAAAEAAAAAwCOiwcAAAAAAAAAAIA4V+azJVgolXkvWQnc75fJfyBac3twvT+U5O0MZOscAAAAADuaygAAjosHAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAQCOiwgAAAAAAAAAAIA4V+azJVgolXkvWQnc75fJfyBac3twvT+U5O0MZOscAAAAAHc1k5wAjosHAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAwCOiwgAAAAAAAAAAOAXzAGq3ZkZvbcMsMHlhc0dspyFt0/fOruQqhzNFIsFAAAAADuayZwAjosGAAAAAQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAA4BfMAardmRm9twywweWFzR2ynIW3T986u5CqHM0UiwU="
601
+ }
602
+ http_version:
603
+ recorded_at: Tue, 05 Jun 2018 15:15:54 GMT
604
+ - request:
605
+ method: get
606
+ uri: https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2
607
+ body:
608
+ encoding: US-ASCII
609
+ string: ''
610
+ headers:
611
+ User-Agent:
612
+ - Faraday v0.15.2
613
+ Accept:
614
+ - application/hal+json,application/problem+json,application/json
615
+ response:
616
+ status:
617
+ code: 200
618
+ message: OK
619
+ headers:
620
+ Date:
621
+ - Tue, 05 Jun 2018 15:15:57 GMT
622
+ Content-Type:
623
+ - application/hal+json; charset=utf-8
624
+ Connection:
625
+ - keep-alive
626
+ Set-Cookie:
627
+ - __cfduid=d4e3325502ab7d6590dcfc0ecd5a4868c1528211757; expires=Wed, 05-Jun-19
628
+ 15:15:57 GMT; path=/; domain=.stellar.org; HttpOnly
629
+ Content-Disposition:
630
+ - inline
631
+ Vary:
632
+ - Origin
633
+ X-Ratelimit-Limit:
634
+ - '17200'
635
+ X-Ratelimit-Remaining:
636
+ - '17173'
637
+ X-Ratelimit-Reset:
638
+ - '3166'
639
+ Expect-Ct:
640
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
641
+ Server:
642
+ - cloudflare
643
+ Cf-Ray:
644
+ - 426398fa5db9b90d-MIA
645
+ body:
646
+ encoding: ASCII-8BIT
647
+ string: |-
648
+ {
649
+ "_links": {
650
+ "self": {
651
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2"
652
+ },
653
+ "transactions": {
654
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/transactions{?cursor,limit,order}",
655
+ "templated": true
656
+ },
657
+ "operations": {
658
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/operations{?cursor,limit,order}",
659
+ "templated": true
660
+ },
661
+ "payments": {
662
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/payments{?cursor,limit,order}",
663
+ "templated": true
664
+ },
665
+ "effects": {
666
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/effects{?cursor,limit,order}",
667
+ "templated": true
668
+ },
669
+ "offers": {
670
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/offers{?cursor,limit,order}",
671
+ "templated": true
672
+ },
673
+ "trades": {
674
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/trades{?cursor,limit,order}",
675
+ "templated": true
676
+ },
677
+ "data": {
678
+ "href": "https://horizon-testnet.stellar.org/accounts/GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2/data/{key}",
679
+ "templated": true
680
+ }
681
+ },
682
+ "id": "GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2",
683
+ "paging_token": "",
684
+ "account_id": "GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2",
685
+ "sequence": "40122308873945088",
686
+ "subentry_count": 0,
687
+ "thresholds": {
688
+ "low_threshold": 0,
689
+ "med_threshold": 0,
690
+ "high_threshold": 0
691
+ },
692
+ "flags": {
693
+ "auth_required": false,
694
+ "auth_revocable": false
695
+ },
696
+ "balances": [
697
+ {
698
+ "balance": "199.9999900",
699
+ "asset_type": "native"
700
+ }
701
+ ],
702
+ "signers": [
703
+ {
704
+ "public_key": "GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2",
705
+ "weight": 1,
706
+ "key": "GCADQV7GWMSVQKEVPEXVSCO456L4S7ZALJZXW4F5H6KOJ3IMMTVRZDH2",
707
+ "type": "ed25519_public_key"
708
+ }
709
+ ],
710
+ "data": {}
711
+ }
712
+ http_version:
713
+ recorded_at: Tue, 05 Jun 2018 15:15:54 GMT
714
+ recorded_with: VCR 3.0.3