stellar-base 0.23.0.pre1 → 0.24.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +249 -0
  3. data/README.md +0 -3
  4. data/generated/stellar-base-generated.rb +29 -1
  5. data/generated/stellar/account_entry.rb +3 -13
  6. data/generated/stellar/account_entry/ext.rb +2 -16
  7. data/generated/stellar/account_entry_extension_v1.rb +32 -0
  8. data/generated/stellar/account_entry_extension_v1/ext.rb +28 -0
  9. data/generated/stellar/account_entry_extension_v2.rb +34 -0
  10. data/generated/stellar/{account_entry/ext/v1 → account_entry_extension_v2}/ext.rb +8 -12
  11. data/generated/stellar/account_merge_result_code.rb +3 -1
  12. data/generated/stellar/begin_sponsoring_future_reserves_op.rb +18 -0
  13. data/generated/stellar/begin_sponsoring_future_reserves_result.rb +25 -0
  14. data/generated/stellar/begin_sponsoring_future_reserves_result_code.rb +29 -0
  15. data/generated/stellar/claim_claimable_balance_op.rb +18 -0
  16. data/generated/stellar/claim_claimable_balance_result.rb +25 -0
  17. data/generated/stellar/claim_claimable_balance_result_code.rb +31 -0
  18. data/generated/stellar/claim_predicate.rb +43 -0
  19. data/generated/stellar/claim_predicate_type.rb +30 -0
  20. data/generated/stellar/claimable_balance_entry.rb +44 -0
  21. data/generated/stellar/claimable_balance_entry/ext.rb +24 -0
  22. data/generated/stellar/claimable_balance_id.rb +23 -0
  23. data/generated/stellar/claimable_balance_id_type.rb +20 -0
  24. data/generated/stellar/claimant.rb +31 -0
  25. data/generated/stellar/claimant/v0.rb +22 -0
  26. data/generated/stellar/claimant_type.rb +20 -0
  27. data/generated/stellar/create_claimable_balance_op.rb +22 -0
  28. data/generated/stellar/create_claimable_balance_result.rb +27 -0
  29. data/generated/stellar/create_claimable_balance_result_code.rb +30 -0
  30. data/generated/stellar/end_sponsoring_future_reserves_result.rb +25 -0
  31. data/generated/stellar/end_sponsoring_future_reserves_result_code.rb +25 -0
  32. data/generated/stellar/envelope_type.rb +3 -1
  33. data/generated/stellar/inner_transaction_result.rb +2 -1
  34. data/generated/stellar/inner_transaction_result/result.rb +3 -1
  35. data/generated/stellar/ledger_entry.rb +4 -0
  36. data/generated/stellar/ledger_entry/data.rb +12 -8
  37. data/generated/stellar/ledger_entry/ext.rb +4 -0
  38. data/generated/stellar/ledger_entry_extension_v1.rb +30 -0
  39. data/generated/stellar/ledger_entry_extension_v1/ext.rb +24 -0
  40. data/generated/stellar/ledger_entry_type.rb +7 -5
  41. data/generated/stellar/ledger_key.rb +17 -8
  42. data/generated/stellar/ledger_key/claimable_balance.rb +20 -0
  43. data/generated/stellar/operation.rb +10 -0
  44. data/generated/stellar/operation/body.rb +45 -26
  45. data/generated/stellar/operation_id.rb +32 -0
  46. data/generated/stellar/operation_id/id.rb +24 -0
  47. data/generated/stellar/operation_result.rb +10 -0
  48. data/generated/stellar/operation_result/tr.rb +48 -28
  49. data/generated/stellar/operation_result_code.rb +3 -1
  50. data/generated/stellar/operation_type.rb +25 -15
  51. data/generated/stellar/path_payment_strict_receive_result.rb +2 -1
  52. data/generated/stellar/revoke_sponsorship_op.rb +36 -0
  53. data/generated/stellar/revoke_sponsorship_op/signer.rb +22 -0
  54. data/generated/stellar/revoke_sponsorship_result.rb +25 -0
  55. data/generated/stellar/revoke_sponsorship_result_code.rb +31 -0
  56. data/generated/stellar/revoke_sponsorship_type.rb +22 -0
  57. data/generated/stellar/transaction_result_code.rb +4 -2
  58. data/lib/stellar-base.rb +15 -5
  59. data/lib/stellar/account_flags.rb +1 -1
  60. data/lib/stellar/{version.rb → base/version.rb} +1 -1
  61. data/lib/stellar/claim_predicate.rb +198 -0
  62. data/lib/stellar/compat.rb +2 -11
  63. data/lib/stellar/dsl.rb +85 -0
  64. data/lib/stellar/ext/xdr.rb +49 -0
  65. data/lib/stellar/fee_bump_transaction.rb +1 -1
  66. data/lib/stellar/key_pair.rb +43 -35
  67. data/lib/stellar/ledger_key.rb +30 -0
  68. data/lib/stellar/networks.rb +12 -12
  69. data/lib/stellar/operation.rb +58 -1
  70. data/lib/stellar/price.rb +11 -2
  71. data/lib/stellar/transaction.rb +17 -167
  72. data/lib/stellar/transaction_builder.rb +35 -18
  73. data/lib/stellar/transaction_envelope.rb +3 -29
  74. data/lib/stellar/transaction_v0.rb +12 -0
  75. data/lib/stellar/util/strkey.rb +7 -7
  76. metadata +164 -33
  77. data/generated/stellar/account_entry/ext/v1.rb +0 -34
  78. data/lib/stellar/util/continued_fraction.rb +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9440334161a80fd870e800622135c71620b4feb002d34cb0ec6513428a653f29
4
- data.tar.gz: 565fd8ffb469d9137470bf36a821bea1072427f38044d3a8cc402ece154fbbb2
3
+ metadata.gz: d13d4f0b46be5ae03ec00a019abebd5846c312d6074beab1656d097fabda353c
4
+ data.tar.gz: 179c7b90ffd0823967006bf92593f6b34418cd6bfb2f2b9e71456e96ef4d4360
5
5
  SHA512:
6
- metadata.gz: 55fb594fa92e0842f738e93e52420aa05a39fefc279d23793bfa9227ce263d52a75f50db61d8cdc6eff5fdf19acdcb36b9f8cdb04c9c6c8373ca368e39a52d4e
7
- data.tar.gz: 79968fe2b3075e1bc6ecdc6c82d6ccad9c74406810a8b0a429e64c48d81acf14a1c48ef5665362051cf147afc6e7d347ad75ddf7fe435fea091cd3d30d285fd9
6
+ metadata.gz: 63a0222c5014c166c3f7b0ce1054783a7cd5132dccbed308763a76c6eadb1165c96dbbb4be2d33d0b75a4edf8f5bda42d73cdee642901bcb1604d2a8cb5a45f1
7
+ data.tar.gz: ad4c8661b62f3f43efcb51d554876f6a6e2b28429b5d1845d8603dbdd3e5ff56f27ee488cc28d59f5482028d70dbfbc15c9f2211875f763718c9c848777eb7b6
@@ -0,0 +1,249 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this
4
+ file. This project adheres to [Semantic Versioning](http://semver.org/).
5
+
6
+ As this project is pre 1.0, breaking changes may happen for minor version
7
+ bumps. A breaking change will get clearly notified in this log.
8
+
9
+ ## [Unreleased]
10
+ ### Added
11
+ - Add conversion methods for KeyPair and Asset
12
+ - Stellar Protocol 14 support
13
+ - Regenerate XDR wrappers from definitions in stellar-core 14.1.1
14
+ - Add [CAP-23 Two-Part Payments](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0023.md) support
15
+ - Add ClaimPredicate DSL methods which help with creation of claim predicates.
16
+ ```
17
+ # use class-level helpers to create simple predicates
18
+ unconditional = Stellar::ClaimPredicate.unconditional
19
+ before_rel_time = Stellar::ClaimPredicate.before_relative_time(1.hour)
20
+ before_abs_time = Stellar::ClaimPredicate.before_absolute_time(Date.tomorrow.beginning_of_day)
21
+
22
+ # negate predicates using `~` unary operator
23
+ ~predicate # same as predicate.not
24
+
25
+ # build complex predicates using `&` and `|` infix operators
26
+ predicate & other_predicate # same as `predicate.and(other_predicate)`
27
+ predicate | other_predicate # same as `predicate.or(other_predicate)`
28
+
29
+ # quickly define complex predicates using `.compose` class method with the block
30
+ unconditional = Stellar::ClaimPredicate.compose { }
31
+ complex = Stellar::ClaimPredicate.compose do
32
+ before_relative_time(1.week) & ~before_relative_time(10.seconds) |
33
+ end
34
+
35
+ # here's what building this predicate would look like without DSL
36
+ complex = Stellar::ClaimPredicate.new(
37
+ Stellar::ClaimPredicateType::AND,
38
+ Stellar::ClaimPredicate.new(
39
+ Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 7 * 24 * 60 * 60
40
+ ),
41
+ Stellar::ClaimPredicate.new(
42
+ Stellar::ClaimPredicateType::NOT, Stellar::ClaimPredicate.new(
43
+ Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 10
44
+ )
45
+ )
46
+ )
47
+
48
+ ```
49
+ - Extend Operation with `create_claimable_balance` and `claim_claimable_balance` helpers
50
+ - Add Claimant and ClaimPredicate DSL methods to reduce the noise.
51
+ ```
52
+ include Stellar::DSL
53
+
54
+ sender = KeyPair('S....')
55
+ recipient = 'G....'
56
+
57
+ op = Operation.create_claimable_balance(
58
+ asset: Stellar::Asset.native,
59
+ amount: 100,
60
+ claimants: [
61
+ Claimant(recipient) { after(10.seconds) & before(1.week) },
62
+ Claimant(sender), # allow unconditional claim-back
63
+ ]
64
+ )
65
+ ])
66
+ ```
67
+ - Add simple predicate evaluation feature so that developers can sanity-check their predicates
68
+ ```
69
+ include Stellar::DSL
70
+
71
+ predicate = ClaimPredicate { before_relative_time(1.week) & ~before_relative_time(10.seconds) }
72
+
73
+ # predicate.evaluate(balance_creation_time, claim_evaluation_time)
74
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:00:05") # => false
75
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:01:00") # => true
76
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 08:50:00") # => true
77
+
78
+ # you can also pass an instance of ActiveSupport::Duration as a second parameter, in this case
79
+ # it works as a relative offset from `balance_creation_time`
80
+ predicate.evaluate("2020-10-20 09:00:00", 1.week + 1.second) # => false
81
+
82
+ # it is effectively the same as
83
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 09:00:01") # => false
84
+ ```
85
+ - Add [CAP-33 Sponsored Reserves](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0033.md) support
86
+ - Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
87
+ - `Operation.begin_sponsoring_future_reserves`
88
+ - `Operation.end_sponsoring_future_reserves`
89
+ - `Operation.revoke_sponsorship(account_id:)`
90
+ - `Operation.revoke_sponsorship(account_id:, asset:)`
91
+ - `Operation.revoke_sponsorship(account_id:, offer_id:)`
92
+ - `Operation.revoke_sponsorship(account_id:, data_name:)`
93
+ - `Operation.revoke_sponsorship(account_id:, balance_id:)`
94
+ - `Operation.revoke_sponsorship(account_id:, signer:)`
95
+
96
+
97
+ ## [0.23.1](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.1...v0.23.0) - 2020-06-18
98
+ ### Added
99
+ - Transaction builder now builds V1 transactions
100
+ - FeeBumpTransaction can wrap V0 transaction
101
+
102
+ ## [0.23.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.0...v0.22.0) - 2020-06-11
103
+ ### Added
104
+ - Stellar Protocol 13 support
105
+ - Fee-Bump transactions ([CAP-0015](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md))
106
+ - Multiplexed accounts ([CAP-0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md))
107
+ - Fine-Grained control on trustline authorization ([CAP-0018](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0018.md))
108
+
109
+ ## [0.22.0](https://github.com/stellar/ruby-stellar-base/compare/v0.21.0...v0.22.0) - 2020-03-26
110
+ ### Added
111
+ - Add TransactionBuilder ([#54](https://github.com/stellar/ruby-stellar-base/issues/54))
112
+
113
+ ### Changed
114
+ - Regenerate XDR files ([#57](https://github.com/stellar/ruby-stellar-base/issues/57))
115
+ - Allow asset objects to be passed instead of list of parameters ([#59](https://github.com/stellar/ruby-stellar-base/issues/59))
116
+
117
+ ## [0.21.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.20.0...v0.21.0) - 2019-10-04
118
+ ### Changed
119
+ - [Stellar Protocol 12 compatibility](https://github.com/bloom-solutions/ruby-stellar-base/pull/51).
120
+ - XDR changes for path payment
121
+ - constant renames, which may cause breaking changes if referred to directly
122
+
123
+ ## [0.20.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.19.0...v0.20.0) - 2019-05-22
124
+ ### Added
125
+ - Stellar Protocol 11 compatibility (#48)
126
+ - XDR changes for [CAP-0006 Buy Offers](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0006.md)
127
+ - XDR changes for [CAP-0020 Bucket Initial Entries](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0020.md)
128
+ - Add `manage_buy_offer`, `manage_sell_offer` and `create_passive_sell_offer` factory methods to `Stellar::Transaction` and `Stellar::Operation`
129
+
130
+ ### Changed
131
+ - Deprecate `manage_offer` and `create_passive_offer` factory methods in `Stellar::Transaction` and `Stellar::Operation`
132
+ - Add an option to pass the exact stellar-core revision into `xdr:update` Rake task
133
+
134
+ ## [0.19.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.18.0...v0.19.0)
135
+ ### Changed
136
+ - Loosen ActiveSupport to >= 5.0.0
137
+
138
+ ## [0.18.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.17.0...v0.18.0)
139
+ ### Added
140
+ - Update XDR definitions for stellar-core v10.0.0 (introduces Liabilities and other changes to support asset-backed offers as per [CAP-0003 Specification](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0003.md#specification))
141
+ - Add factories for ledger, transaction, operation.
142
+
143
+ ### Changed
144
+ - Use rbnacl instead of rbnacl-libsodium (the latter has been [deprecated](https://github.com/crypto-rb/rbnacl-libsodium/issues/29))
145
+
146
+ ## [0.17.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.16.0...v0.17.0)
147
+ ### Fixed
148
+ - Rename `Stellar::SignerKey#onetime_signer` helper to `Stellar::SignerKey#hash_x`, add preimage validations
149
+
150
+ ## [0.16.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.15.0...v0.16.0)
151
+ ### Added
152
+ - Create co-signers conveniently using helpers `ed25519(keypair)`, `preauthorized_transaction(tx)` and `onetime_signer(preimage)` from `Stellar::SignerKey` module
153
+ - Merge two transactions with `Stellar::TransactionEnvelope#merge`
154
+
155
+ ### Fixed
156
+ - Source account overriding in Stellar::Transaction#to_operations
157
+
158
+ ## [0.15.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.14.0...v0.15.0)
159
+ ### Added
160
+ - `Stellar::Operation.change_trust` can accept `Stellar::Asset` instance for `line`
161
+
162
+ ### Fixed
163
+ - Protect `Stellar::Operation.change_trust` against malicious arguments, in the event that developers pass this argument directly from user input
164
+
165
+ ## [0.14.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.13.0...v0.14.0)
166
+
167
+ ### Added
168
+ - We now support the bump sequence operation with `Operation.bump_sequence`.
169
+
170
+ ### Changed
171
+ - Update XDR definitions for stellar-core 0.10.0 support
172
+ - `Operation.change_trust` learned how to use a default for the `:limit` parameter
173
+ - `StrKey` learned about new version bytes `pre_auth_tx` and `hash_x`
174
+
175
+ ## [0.13.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.12.0...v0.13.0)
176
+
177
+ ### Changed
178
+ - Update XDR definitions for stellar-core 0.9.1 support
179
+
180
+ ### Added
181
+ - Added `#signer_key` helper to `KeyPair`
182
+
183
+ ## [0.12.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.11.0...v0.12.0)
184
+
185
+ ### Changed
186
+ - Avoid modifying $LOAD_PATH to fix load order issues
187
+ - Update XDR definitions for stellar-core 0.6 support
188
+
189
+ ### Removed
190
+
191
+ - BREAKING CHANGE: Removed support for JRuby.
192
+
193
+ ## [0.11.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.10.0...v0.11.0)
194
+
195
+ ### Added
196
+ - Added support for `manage_data` operations
197
+
198
+ ### Changed
199
+ - `Stellar::Transaction#to_envelope` can now be used without arguments, returning a `Stellar::TransactionEnvelope` with zero signatures.
200
+
201
+ ## [0.10.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.9.0...v0.10.0)
202
+
203
+ - Added memo helpers to `Stellar::Transaction.for_account`, allowing any operation builder (such as `Stellar::Transaction.payment) to provide a custom memo using the `:memo` attribute.
204
+
205
+ ## [0.9.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.8.0...v0.9.0)
206
+
207
+ ### Changed
208
+ - XDR Definitions have been updated to stellar-core commit eed89649c2060b8e9dacffe2cec4e8b258b32416
209
+
210
+ ## [0.8.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.7.0...v0.8.0)
211
+
212
+ ### Changed
213
+ - BREAKING CHANGE: The default network for this library is now the stellar test network.
214
+ To enable this library for the production network use `Stellar.default_network = Stellar::Networks::PUBLIC`
215
+ at the head of your script or in your configuration function.
216
+
217
+ ## [0.7.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.6.1...v0.7.0)
218
+
219
+ ### Changed
220
+
221
+ - Bump xdr dependency to 1.0.0
222
+
223
+ ## [0.6.1](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.6.0...v0.6.1)
224
+
225
+ ### Changed
226
+
227
+ - Update default fee for transactions to new minimum of 100 stroops
228
+
229
+
230
+ ## [0.6.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.5.0...v0.6.0)
231
+
232
+ ### Changed
233
+
234
+ - Update to latest xdr (stellar-core commit ad22bccafbbc14a358f05a989f7b95714dc9d4c6)
235
+
236
+ ## [0.5.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.4.0...v0.5.0)
237
+
238
+ ### Changed
239
+
240
+ - Update to latest xdr
241
+
242
+ ## [0.4.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.3.0...v0.4.0)
243
+
244
+ ### Changed
245
+ - BREAKING CHANGE: "Amounts", that is, input parameters that represent a
246
+ certain amount of a given asset, such as the `:starting_balance` option for
247
+ `Operation.create_account` are now interpreted using the convention of 7
248
+ fixed-decimal places. For example, specifying a payment where the amount is
249
+ `50` will result in a transaction with an amount set to `500000000`.
data/README.md CHANGED
@@ -12,15 +12,12 @@ Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
14
  gem 'stellar-base'
15
- gem 'xdr', git: 'https://github.com/stellar/ruby-xdr.git', tag: 'v3.0.1'
16
15
  ```
17
16
 
18
17
  And then execute:
19
18
 
20
19
  $ bundle
21
20
 
22
- **Note** we need to add such explicit xdr dependency, because version 3.0.1 is not on RubyGems yet. When it's published, you can remove this line
23
-
24
21
  Also requires libsodium. Installable via `brew install libsodium` on OS X.
25
22
 
26
23
  ## Supported Ruby Versions
@@ -46,6 +46,10 @@ module Stellar
46
46
  autoload :Signer
47
47
  autoload :AccountFlags
48
48
  MASK_ACCOUNT_FLAGS = 0x7
49
+ MAX_SIGNERS = 20
50
+ SponsorshipDescriptor = XDR::Option[AccountID]
51
+ autoload :AccountEntryExtensionV2
52
+ autoload :AccountEntryExtensionV1
49
53
  autoload :AccountEntry
50
54
  autoload :TrustLineFlags
51
55
  MASK_TRUSTLINE_FLAGS = 1
@@ -55,7 +59,16 @@ module Stellar
55
59
  MASK_OFFERENTRY_FLAGS = 1
56
60
  autoload :OfferEntry
57
61
  autoload :DataEntry
62
+ autoload :ClaimPredicateType
63
+ autoload :ClaimPredicate
64
+ autoload :ClaimantType
65
+ autoload :Claimant
66
+ autoload :ClaimableBalanceIDType
67
+ autoload :ClaimableBalanceID
68
+ autoload :ClaimableBalanceEntry
69
+ autoload :LedgerEntryExtensionV1
58
70
  autoload :LedgerEntry
71
+ autoload :LedgerKey
59
72
  autoload :EnvelopeType
60
73
  end
61
74
  module Stellar
@@ -76,7 +89,13 @@ module Stellar
76
89
  autoload :AllowTrustOp
77
90
  autoload :ManageDataOp
78
91
  autoload :BumpSequenceOp
92
+ autoload :CreateClaimableBalanceOp
93
+ autoload :ClaimClaimableBalanceOp
94
+ autoload :BeginSponsoringFutureReservesOp
95
+ autoload :RevokeSponsorshipType
96
+ autoload :RevokeSponsorshipOp
79
97
  autoload :Operation
98
+ autoload :OperationID
80
99
  autoload :MemoType
81
100
  autoload :Memo
82
101
  autoload :TimeBounds
@@ -120,6 +139,16 @@ module Stellar
120
139
  autoload :ManageDataResult
121
140
  autoload :BumpSequenceResultCode
122
141
  autoload :BumpSequenceResult
142
+ autoload :CreateClaimableBalanceResultCode
143
+ autoload :CreateClaimableBalanceResult
144
+ autoload :ClaimClaimableBalanceResultCode
145
+ autoload :ClaimClaimableBalanceResult
146
+ autoload :BeginSponsoringFutureReservesResultCode
147
+ autoload :BeginSponsoringFutureReservesResult
148
+ autoload :EndSponsoringFutureReservesResultCode
149
+ autoload :EndSponsoringFutureReservesResult
150
+ autoload :RevokeSponsorshipResultCode
151
+ autoload :RevokeSponsorshipResult
123
152
  autoload :OperationResultCode
124
153
  autoload :OperationResult
125
154
  autoload :TransactionResultCode
@@ -137,7 +166,6 @@ module Stellar
137
166
  autoload :LedgerHeader
138
167
  autoload :LedgerUpgradeType
139
168
  autoload :LedgerUpgrade
140
- autoload :LedgerKey
141
169
  autoload :BucketEntryType
142
170
  autoload :BucketMetadata
143
171
  autoload :BucketEntry
@@ -21,7 +21,7 @@ require 'xdr'
21
21
  # // thresholds stores unsigned bytes: [weight of master|low|medium|high]
22
22
  # Thresholds thresholds;
23
23
  #
24
- # Signer signers<20>; // possible signers for this account
24
+ # Signer signers<MAX_SIGNERS>; // possible signers for this account
25
25
  #
26
26
  # // reserved for future use
27
27
  # union switch (int v)
@@ -29,17 +29,7 @@ require 'xdr'
29
29
  # case 0:
30
30
  # void;
31
31
  # case 1:
32
- # struct
33
- # {
34
- # Liabilities liabilities;
35
- #
36
- # union switch (int v)
37
- # {
38
- # case 0:
39
- # void;
40
- # }
41
- # ext;
42
- # } v1;
32
+ # AccountEntryExtensionV1 v1;
43
33
  # }
44
34
  # ext;
45
35
  # };
@@ -59,7 +49,7 @@ module Stellar
59
49
  attribute :flags, Uint32
60
50
  attribute :home_domain, String32
61
51
  attribute :thresholds, Thresholds
62
- attribute :signers, XDR::VarArray[Signer, 20]
52
+ attribute :signers, XDR::VarArray[Signer, MAX_SIGNERS]
63
53
  attribute :ext, Ext
64
54
  end
65
55
  end
@@ -10,33 +10,19 @@ require 'xdr'
10
10
  # case 0:
11
11
  # void;
12
12
  # case 1:
13
- # struct
14
- # {
15
- # Liabilities liabilities;
16
- #
17
- # union switch (int v)
18
- # {
19
- # case 0:
20
- # void;
21
- # }
22
- # ext;
23
- # } v1;
13
+ # AccountEntryExtensionV1 v1;
24
14
  # }
25
15
  #
26
16
  # ===========================================================================
27
17
  module Stellar
28
18
  class AccountEntry
29
19
  class Ext < XDR::Union
30
- include XDR::Namespace
31
-
32
- autoload :V1
33
-
34
20
  switch_on XDR::Int, :v
35
21
 
36
22
  switch 0
37
23
  switch 1, :v1
38
24
 
39
- attribute :v1, V1
25
+ attribute :v1, AccountEntryExtensionV1
40
26
  end
41
27
  end
42
28
  end
@@ -0,0 +1,32 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct AccountEntryExtensionV1
9
+ # {
10
+ # Liabilities liabilities;
11
+ #
12
+ # union switch (int v)
13
+ # {
14
+ # case 0:
15
+ # void;
16
+ # case 2:
17
+ # AccountEntryExtensionV2 v2;
18
+ # }
19
+ # ext;
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class AccountEntryExtensionV1 < XDR::Struct
25
+ include XDR::Namespace
26
+
27
+ autoload :Ext
28
+
29
+ attribute :liabilities, Liabilities
30
+ attribute :ext, Ext
31
+ end
32
+ end