stellar-base 0.26.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -32
  3. data/README.md +3 -3
  4. data/generated/stellar/account_flags.rb +9 -4
  5. data/generated/stellar/account_merge_result.rb +1 -1
  6. data/generated/stellar/allow_trust_op.rb +3 -18
  7. data/generated/stellar/allow_trust_result_code.rb +4 -1
  8. data/generated/stellar/alpha_num12.rb +20 -0
  9. data/generated/stellar/alpha_num4.rb +20 -0
  10. data/generated/stellar/asset.rb +2 -15
  11. data/generated/stellar/asset_code.rb +30 -0
  12. data/generated/stellar/asset_type.rb +3 -1
  13. data/generated/stellar/begin_sponsoring_future_reserves_result.rb +2 -1
  14. data/generated/stellar/change_trust_asset.rb +39 -0
  15. data/generated/stellar/change_trust_op.rb +2 -2
  16. data/generated/stellar/change_trust_result_code.rb +13 -7
  17. data/generated/stellar/claim_atom.rb +31 -0
  18. data/generated/stellar/claim_atom_type.rb +24 -0
  19. data/generated/stellar/claim_liquidity_atom.rb +30 -0
  20. data/generated/stellar/claim_offer_atom_v0.rb +33 -0
  21. data/generated/stellar/claimable_balance_entry/ext.rb +4 -0
  22. data/generated/stellar/claimable_balance_entry.rb +2 -0
  23. data/generated/stellar/{asset/alpha_num12.rb → claimable_balance_entry_extension_v1/ext.rb} +9 -7
  24. data/generated/stellar/{operation_id.rb → claimable_balance_entry_extension_v1.rb} +12 -14
  25. data/generated/stellar/claimable_balance_flags.rb +22 -0
  26. data/generated/stellar/clawback_claimable_balance_op.rb +18 -0
  27. data/generated/stellar/clawback_claimable_balance_result.rb +26 -0
  28. data/generated/stellar/clawback_claimable_balance_result_code.rb +29 -0
  29. data/generated/stellar/clawback_op.rb +22 -0
  30. data/generated/stellar/clawback_result.rb +25 -0
  31. data/generated/stellar/clawback_result_code.rb +31 -0
  32. data/generated/stellar/create_passive_sell_offer_op.rb +1 -1
  33. data/generated/stellar/end_sponsoring_future_reserves_result.rb +2 -1
  34. data/generated/stellar/envelope_type.rb +10 -8
  35. data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +4 -4
  36. data/generated/stellar/hash_id_preimage/revoke_id.rb +28 -0
  37. data/generated/stellar/hash_id_preimage.rb +44 -0
  38. data/generated/stellar/ledger_entry/data.rb +4 -0
  39. data/generated/stellar/ledger_entry.rb +2 -0
  40. data/generated/stellar/ledger_entry_type.rb +3 -1
  41. data/generated/stellar/ledger_header/ext.rb +4 -0
  42. data/generated/stellar/ledger_header.rb +2 -0
  43. data/generated/stellar/ledger_header_extension_v1/ext.rb +24 -0
  44. data/generated/stellar/ledger_header_extension_v1.rb +30 -0
  45. data/generated/stellar/ledger_header_flags.rb +24 -0
  46. data/generated/stellar/{asset/alpha_num4.rb → ledger_key/liquidity_pool.rb} +4 -6
  47. data/generated/stellar/ledger_key/trust_line.rb +2 -2
  48. data/generated/stellar/ledger_key.rb +10 -1
  49. data/generated/stellar/ledger_upgrade.rb +4 -0
  50. data/generated/stellar/ledger_upgrade_type.rb +3 -1
  51. data/generated/stellar/liquidity_pool_constant_product_parameters.rb +22 -0
  52. data/generated/stellar/liquidity_pool_deposit_op.rb +26 -0
  53. data/generated/stellar/liquidity_pool_deposit_result.rb +26 -0
  54. data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
  55. data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +31 -0
  56. data/generated/stellar/liquidity_pool_entry/body.rb +37 -0
  57. data/generated/stellar/liquidity_pool_entry.rb +38 -0
  58. data/generated/stellar/liquidity_pool_parameters.rb +23 -0
  59. data/generated/stellar/liquidity_pool_type.rb +20 -0
  60. data/generated/stellar/liquidity_pool_withdraw_op.rb +24 -0
  61. data/generated/stellar/liquidity_pool_withdraw_result.rb +26 -0
  62. data/generated/stellar/liquidity_pool_withdraw_result_code.rb +36 -0
  63. data/generated/stellar/manage_offer_success_result.rb +2 -2
  64. data/generated/stellar/operation/body.rb +20 -0
  65. data/generated/stellar/operation.rb +10 -0
  66. data/generated/stellar/operation_result/tr.rb +20 -0
  67. data/generated/stellar/operation_result.rb +10 -0
  68. data/generated/stellar/operation_type.rb +11 -1
  69. data/generated/stellar/path_payment_strict_receive_result/success.rb +2 -2
  70. data/generated/stellar/path_payment_strict_receive_result.rb +1 -1
  71. data/generated/stellar/path_payment_strict_send_result/success.rb +2 -2
  72. data/generated/stellar/path_payment_strict_send_result.rb +1 -1
  73. data/generated/stellar/payment_result_code.rb +1 -1
  74. data/generated/stellar/revoke_sponsorship_op.rb +1 -2
  75. data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
  76. data/generated/stellar/scp_quorum_set.rb +2 -2
  77. data/generated/stellar/set_options_result_code.rb +14 -11
  78. data/generated/stellar/set_trust_line_flags_op.rb +25 -0
  79. data/generated/stellar/set_trust_line_flags_result.rb +25 -0
  80. data/generated/stellar/set_trust_line_flags_result_code.rb +34 -0
  81. data/generated/stellar/transaction_result_code.rb +1 -1
  82. data/generated/stellar/trust_line_asset.rb +39 -0
  83. data/generated/stellar/trust_line_entry/ext/v1/ext.rb +4 -0
  84. data/generated/stellar/trust_line_entry/ext/v1.rb +2 -0
  85. data/generated/stellar/trust_line_entry/ext.rb +2 -0
  86. data/generated/stellar/trust_line_entry.rb +7 -5
  87. data/generated/stellar/trust_line_entry_extension_v2/ext.rb +24 -0
  88. data/generated/stellar/trust_line_entry_extension_v2.rb +30 -0
  89. data/generated/stellar/trust_line_flags.rb +5 -1
  90. data/generated/stellar-base-generated.rb +40 -1
  91. data/lib/stellar/account.rb +59 -0
  92. data/lib/stellar/account_flags.rb +1 -1
  93. data/lib/stellar/amount.rb +36 -0
  94. data/lib/stellar/asset.rb +8 -0
  95. data/lib/stellar/compat.rb +6 -3
  96. data/lib/stellar/concerns/transaction.rb +4 -2
  97. data/lib/stellar/dsl.rb +26 -0
  98. data/lib/stellar/ledger_key.rb +5 -3
  99. data/lib/stellar/liquidity_pool/base_pool.rb +47 -0
  100. data/lib/stellar/liquidity_pool/constant_product_pool.rb +15 -0
  101. data/lib/stellar/liquidity_pool.rb +12 -0
  102. data/lib/stellar/operation.rb +357 -386
  103. data/lib/stellar/price.rb +13 -7
  104. data/lib/stellar/transaction_builder.rb +27 -11
  105. data/lib/stellar/trust_line_flags.rb +53 -0
  106. data/lib/stellar/util/strkey.rb +15 -7
  107. data/lib/stellar/version.rb +3 -0
  108. data/lib/stellar-base.rb +5 -2
  109. metadata +61 -16
  110. data/generated/stellar/allow_trust_op/asset.rb +0 -33
  111. data/lib/stellar/base/version.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b29836900dbce5c01176c3b92c7c3ef365dbca086d700258e00299edf3edbd61
4
- data.tar.gz: 0c17163d8d41dc0c7847ea888d5e2650b715dc43ecd552f292dc1090fce6e786
3
+ metadata.gz: e9ac52e5c6ee35610edeab9f27a3e48cd57c641d1270322b2419dd5024ebcbd0
4
+ data.tar.gz: 32aef3aced95b9537e6650927621e5a33c6cf6eedb40ab5766dbaf92224e6d02
5
5
  SHA512:
6
- metadata.gz: d2470776823bd7581c6b0985756001fbfb796368aa8ecb2f6c0ead49c13b776dad0405a37b3f3f9c33c3765b84103a16cd4854a3122e1a4e9ef6712ffa1b12fe
7
- data.tar.gz: 1c13e6d755225adc62c22f9e917e74ec178d85df6bfd440ab9ae65d757830c393bab00bb63fb9c8abac34af6c0044a738dea0a1acad03969dda754a627022875
6
+ metadata.gz: f220d030282b21fc515eb6773959a6edfdf8e60f4232e490006b1e68024f2af86c5672c1b210e03728244e6e06729d9c7fb77adaefb44bc6e2deee6fdaed9475
7
+ data.tar.gz: cd7ce1b154f42558b021a8173017487321f8d20a59e84c37538bc826a2f4d6cb272162f3875ebf6d383308ffea486406c456e6759a36f82da0a94a8488c31b2c
data/CHANGELOG.md CHANGED
@@ -1,25 +1,47 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this
4
- file. The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/).
4
+ file. The format is based on [Keep a Changelog](https://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
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
- ## [Unreleased](https://github.com/stellar/ruby-stellar-sdk/compare/v0.26.0...master)
10
+ ## [0.30.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.29.0...v0.30.0) (2021-10-14)
11
11
 
12
- ## [0.26.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.25.0...0.26.0) - 2021-02-05
12
+ ### Added
13
+ * **protocol** support Stellar protocol 18 ([#202](https://www.github.com/astroband/ruby-stellar-sdk/issues/202)) ([3cd93dc](https://github.com/astroband/ruby-stellar-sdk/commit/3cd93dc107ab84b8d3abb10a63a6dca0887f9a4d))
14
+ ### Changed
15
+ * `Stellar::Amount` class moved to `stellar-base` gem from `stellar-sdk`
16
+ * `Stellar::Horizon::Problem` class moved to `stellar-horizon` gem
17
+ * `toml-rb` gem is replaced with `tomlrb` gem to work around [segfaults in Ruby 3.0](https://github.com/mjackson/citrus/issues/60)
18
+
19
+ ## [0.29.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.28.0...v0.29.0) (2021-09-07)
20
+ - No changes
21
+
22
+ ## [0.28.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.27.0...v0.28.0) (2021-07-17)
23
+
24
+ ### Features
25
+
26
+ * support muxed accounts in tx builder ([#162](https://www.github.com/astroband/ruby-stellar-sdk/issues/162)) ([37cd954](https://www.github.com/astroband/ruby-stellar-sdk/commit/37cd954f92c7999a74ca779e795dde74a3d71aad))
27
+
28
+ ## [0.27.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.26.0...v0.27.0) (2021-05-08)
29
+
30
+ ### Features
31
+
32
+ * **protocol:** support Stellar protocol 17 ([#137](https://www.github.com/astroband/ruby-stellar-sdk/issues/137)) ([5fea84d](https://www.github.com/astroband/ruby-stellar-sdk/commit/5fea84d8c3b10b7afc00a10415e8fea01c25eec7))
33
+
34
+ ## [0.26.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.25.0...v0.26.0) - 2021-02-05
13
35
  - No changes
14
36
 
15
- ## [0.25.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.24.0...v0.25.0) - 2020-10-30
37
+ ## [0.25.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.24.0...v0.25.0) - 2020-10-30
16
38
  ### Added
17
39
  - `MuxedAccount` implements `#to_keypair` conversion protocol
18
40
  - `MuxedAccount` correctly responds to `#address` with strkey encoded public key
19
41
  ### Fixed
20
42
  - `Transaction::V0#source_account` now properly returns `MuxedAccount` instead of raw bytes
21
43
 
22
- ## [0.24.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.1...v0.24.0) - 2020-10-20
44
+ ## [0.24.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.23.1...v0.24.0) - 2020-10-20
23
45
  ### Added
24
46
  - Add conversion methods for KeyPair and Asset
25
47
  - Stellar Protocol 14 support
@@ -107,33 +129,33 @@ bumps. A breaking change will get clearly notified in this log.
107
129
  - `Operation.revoke_sponsorship(account_id:, signer:)`
108
130
 
109
131
 
110
- ## [0.23.1](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.0...v0.23.1) - 2020-06-18
132
+ ## [0.23.1](https://github.com/astroband/ruby-stellar-sdk/compare/v0.23.0...v0.23.1) - 2020-06-18
111
133
  ### Added
112
134
  - Transaction builder now builds V1 transactions
113
135
  - FeeBumpTransaction can wrap V0 transaction
114
136
 
115
- ## [0.23.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.22.0...v0.23.0) - 2020-06-11
137
+ ## [0.23.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.22.0...v0.23.0) - 2020-06-11
116
138
  ### Added
117
139
  - Stellar Protocol 13 support
118
140
  - Fee-Bump transactions ([CAP-0015](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md))
119
141
  - Multiplexed accounts ([CAP-0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md))
120
142
  - Fine-Grained control on trustline authorization ([CAP-0018](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0018.md))
121
143
 
122
- ## [0.22.0](https://github.com/stellar/ruby-stellar-base/compare/v0.21.0...v0.22.0) - 2020-03-26
144
+ ## [0.22.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.21.0...base-v0.22.0) - 2020-03-26
123
145
  ### Added
124
- - Add TransactionBuilder ([#54](https://github.com/stellar/ruby-stellar-base/issues/54))
146
+ - Add TransactionBuilder ([#54](https://github.com/astroband/ruby-stellar-base/issues/54))
125
147
 
126
148
  ### Changed
127
- - Regenerate XDR files ([#57](https://github.com/stellar/ruby-stellar-base/issues/57))
128
- - Allow asset objects to be passed instead of list of parameters ([#59](https://github.com/stellar/ruby-stellar-base/issues/59))
149
+ - Regenerate XDR files ([#57](https://github.com/astroband/ruby-stellar-base/issues/57))
150
+ - Allow asset objects to be passed instead of list of parameters ([#59](https://github.com/astroband/ruby-stellar-base/issues/59))
129
151
 
130
- ## [0.21.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.20.0...v0.21.0) - 2019-10-04
152
+ ## [0.21.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.20.0...base-v0.21.0) - 2019-10-04
131
153
  ### Changed
132
- - [Stellar Protocol 12 compatibility](https://github.com/bloom-solutions/ruby-stellar-base/pull/51).
154
+ - [Stellar Protocol 12 compatibility](https://github.com/astroband/ruby-stellar-base/pull/51).
133
155
  - XDR changes for path payment
134
156
  - constant renames, which may cause breaking changes if referred to directly
135
157
 
136
- ## [0.20.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.19.0...v0.20.0) - 2019-05-22
158
+ ## [0.20.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.19.0...base-v0.20.0) - 2019-05-22
137
159
  ### Added
138
160
  - Stellar Protocol 11 compatibility (#48)
139
161
  - XDR changes for [CAP-0006 Buy Offers](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0006.md)
@@ -144,11 +166,11 @@ bumps. A breaking change will get clearly notified in this log.
144
166
  - Deprecate `manage_offer` and `create_passive_offer` factory methods in `Stellar::Transaction` and `Stellar::Operation`
145
167
  - Add an option to pass the exact stellar-core revision into `xdr:update` Rake task
146
168
 
147
- ## [0.19.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.18.0...v0.19.0)
169
+ ## [0.19.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.18.0...base-v0.19.0)
148
170
  ### Changed
149
171
  - Loosen ActiveSupport to >= 5.0.0
150
172
 
151
- ## [0.18.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.17.0...v0.18.0)
173
+ ## [0.18.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.17.0...base-v0.18.0)
152
174
  ### Added
153
175
  - 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))
154
176
  - Add factories for ledger, transaction, operation.
@@ -156,11 +178,11 @@ bumps. A breaking change will get clearly notified in this log.
156
178
  ### Changed
157
179
  - Use rbnacl instead of rbnacl-libsodium (the latter has been [deprecated](https://github.com/crypto-rb/rbnacl-libsodium/issues/29))
158
180
 
159
- ## [0.17.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.16.0...v0.17.0)
181
+ ## [0.17.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.16.0...base-v0.17.0)
160
182
  ### Fixed
161
183
  - Rename `Stellar::SignerKey#onetime_signer` helper to `Stellar::SignerKey#hash_x`, add preimage validations
162
184
 
163
- ## [0.16.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.15.0...v0.16.0)
185
+ ## [0.16.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.15.0...base-v0.16.0)
164
186
  ### Added
165
187
  - Create co-signers conveniently using helpers `ed25519(keypair)`, `preauthorized_transaction(tx)` and `onetime_signer(preimage)` from `Stellar::SignerKey` module
166
188
  - Merge two transactions with `Stellar::TransactionEnvelope#merge`
@@ -168,14 +190,14 @@ bumps. A breaking change will get clearly notified in this log.
168
190
  ### Fixed
169
191
  - Source account overriding in Stellar::Transaction#to_operations
170
192
 
171
- ## [0.15.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.14.0...v0.15.0)
193
+ ## [0.15.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.14.0...base-v0.15.0)
172
194
  ### Added
173
195
  - `Stellar::Operation.change_trust` can accept `Stellar::Asset` instance for `line`
174
196
 
175
197
  ### Fixed
176
198
  - Protect `Stellar::Operation.change_trust` against malicious arguments, in the event that developers pass this argument directly from user input
177
199
 
178
- ## [0.14.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.13.0...v0.14.0)
200
+ ## [0.14.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.13.0...base-v0.14.0)
179
201
 
180
202
  ### Added
181
203
  - We now support the bump sequence operation with `Operation.bump_sequence`.
@@ -185,7 +207,7 @@ bumps. A breaking change will get clearly notified in this log.
185
207
  - `Operation.change_trust` learned how to use a default for the `:limit` parameter
186
208
  - `StrKey` learned about new version bytes `pre_auth_tx` and `hash_x`
187
209
 
188
- ## [0.13.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.12.0...v0.13.0)
210
+ ## [0.13.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.12.0...base-v0.13.0)
189
211
 
190
212
  ### Changed
191
213
  - Update XDR definitions for stellar-core 0.9.1 support
@@ -193,7 +215,7 @@ bumps. A breaking change will get clearly notified in this log.
193
215
  ### Added
194
216
  - Added `#signer_key` helper to `KeyPair`
195
217
 
196
- ## [0.12.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.11.0...v0.12.0)
218
+ ## [0.12.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.11.0...base-v0.12.0)
197
219
 
198
220
  ### Changed
199
221
  - Avoid modifying $LOAD_PATH to fix load order issues
@@ -203,7 +225,7 @@ bumps. A breaking change will get clearly notified in this log.
203
225
 
204
226
  - BREAKING CHANGE: Removed support for JRuby.
205
227
 
206
- ## [0.11.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.10.0...v0.11.0)
228
+ ## [0.11.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.10.0...base-v0.11.0)
207
229
 
208
230
  ### Added
209
231
  - Added support for `manage_data` operations
@@ -211,48 +233,48 @@ bumps. A breaking change will get clearly notified in this log.
211
233
  ### Changed
212
234
  - `Stellar::Transaction#to_envelope` can now be used without arguments, returning a `Stellar::TransactionEnvelope` with zero signatures.
213
235
 
214
- ## [0.10.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.9.0...v0.10.0)
236
+ ## [0.10.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.9.0...base-v0.10.0)
215
237
 
216
238
  - 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.
217
239
 
218
- ## [0.9.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.8.0...v0.9.0)
240
+ ## [0.9.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.8.0...base-v0.9.0)
219
241
 
220
242
  ### Changed
221
243
  - XDR Definitions have been updated to stellar-core commit eed89649c2060b8e9dacffe2cec4e8b258b32416
222
244
 
223
- ## [0.8.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.7.0...v0.8.0)
245
+ ## [0.8.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.7.0...base-v0.8.0)
224
246
 
225
247
  ### Changed
226
248
  - BREAKING CHANGE: The default network for this library is now the stellar test network.
227
249
  To enable this library for the production network use `Stellar.default_network = Stellar::Networks::PUBLIC`
228
250
  at the head of your script or in your configuration function.
229
251
 
230
- ## [0.7.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.6.1...v0.7.0)
252
+ ## [0.7.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.6.1...base-v0.7.0)
231
253
 
232
254
  ### Changed
233
255
 
234
256
  - Bump xdr dependency to 1.0.0
235
257
 
236
- ## [0.6.1](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.6.0...v0.6.1)
258
+ ## [0.6.1](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.6.0...base-v0.6.1)
237
259
 
238
260
  ### Changed
239
261
 
240
262
  - Update default fee for transactions to new minimum of 100 stroops
241
263
 
242
264
 
243
- ## [0.6.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.5.0...v0.6.0)
265
+ ## [0.6.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.5.0...base-v0.6.0)
244
266
 
245
267
  ### Changed
246
268
 
247
269
  - Update to latest xdr (stellar-core commit ad22bccafbbc14a358f05a989f7b95714dc9d4c6)
248
270
 
249
- ## [0.5.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.4.0...v0.5.0)
271
+ ## [0.5.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.4.0...base-v0.5.0)
250
272
 
251
273
  ### Changed
252
274
 
253
275
  - Update to latest xdr
254
276
 
255
- ## [0.4.0](https://github.com/bloom-solutions/ruby-stellar-base/compare/v0.3.0...v0.4.0)
277
+ ## [0.4.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.3.0...base-v0.4.0)
256
278
 
257
279
  ### Changed
258
280
  - BREAKING CHANGE: "Amounts", that is, input parameters that represent a
data/README.md CHANGED
@@ -22,7 +22,7 @@ Also requires libsodium. Installable via `brew install libsodium` on OS X.
22
22
 
23
23
  ## Supported Ruby Versions
24
24
 
25
- Please see [travis.yml](.travis.yml) for what versions of ruby are currently tested by our continuous integration system. Any ruby in that list is officially supported.
25
+ Please see [CI Workflow](https://github.com/astroband/ruby-stellar-sdk/actions/workflows/ci.yml) for what versions of ruby are currently tested by our continuous integration system. Any ruby in that list is officially supported.
26
26
 
27
27
  ### JRuby
28
28
 
@@ -32,7 +32,7 @@ It seems as though jruby is particularly slow when it comes to BigDecimal math;
32
32
 
33
33
  [Examples are here](examples)
34
34
 
35
- In addition to the code generated from the XDR definition files (see [ruby-xdr](https://github.com/stellar/ruby-xdr) for example usage), this library also provides some stellar specific features. Let's look at some of them.
35
+ In addition to the code generated from the XDR definition files (see [ruby-xdr](https://github.com/astroband/ruby-xdr) for example usage), this library also provides some stellar specific features. Let's look at some of them.
36
36
 
37
37
  We wrap rbnacl with `Stellar::KeyPair`, providing some stellar specific functionality as seen below:
38
38
 
@@ -84,4 +84,4 @@ The current integration of user-written code with auto-generated classes is to p
84
84
 
85
85
  ## Contributing
86
86
 
87
- Please [see CONTRIBUTING.md for details](CONTRIBUTING.md).
87
+ Please [see CONTRIBUTING.md for details](../CONTRIBUTING.md).
@@ -16,15 +16,20 @@ require 'xdr'
16
16
  # // otherwise, authorization cannot be revoked
17
17
  # AUTH_REVOCABLE_FLAG = 0x2,
18
18
  # // Once set, causes all AUTH_* flags to be read-only
19
- # AUTH_IMMUTABLE_FLAG = 0x4
19
+ # AUTH_IMMUTABLE_FLAG = 0x4,
20
+ # // Trustlines are created with clawback enabled set to "true",
21
+ # // and claimable balances created from those trustlines are created
22
+ # // with clawback enabled set to "true"
23
+ # AUTH_CLAWBACK_ENABLED_FLAG = 0x8
20
24
  # };
21
25
  #
22
26
  # ===========================================================================
23
27
  module Stellar
24
28
  class AccountFlags < XDR::Enum
25
- member :auth_required_flag, 1
26
- member :auth_revocable_flag, 2
27
- member :auth_immutable_flag, 4
29
+ member :auth_required_flag, 1
30
+ member :auth_revocable_flag, 2
31
+ member :auth_immutable_flag, 4
32
+ member :auth_clawback_enabled_flag, 8
28
33
 
29
34
  seal
30
35
  end
@@ -8,7 +8,7 @@ require 'xdr'
8
8
  # union AccountMergeResult switch (AccountMergeResultCode code)
9
9
  # {
10
10
  # case ACCOUNT_MERGE_SUCCESS:
11
- # int64 sourceAccountBalance; // how much got transfered from source account
11
+ # int64 sourceAccountBalance; // how much got transferred from source account
12
12
  # default:
13
13
  # void;
14
14
  # };
@@ -8,32 +8,17 @@ require 'xdr'
8
8
  # struct AllowTrustOp
9
9
  # {
10
10
  # AccountID trustor;
11
- # union switch (AssetType type)
12
- # {
13
- # // ASSET_TYPE_NATIVE is not allowed
14
- # case ASSET_TYPE_CREDIT_ALPHANUM4:
15
- # AssetCode4 assetCode4;
11
+ # AssetCode asset;
16
12
  #
17
- # case ASSET_TYPE_CREDIT_ALPHANUM12:
18
- # AssetCode12 assetCode12;
19
- #
20
- # // add other asset types here in the future
21
- # }
22
- # asset;
23
- #
24
- # // 0, or any bitwise combination of TrustLineFlags
13
+ # // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG
25
14
  # uint32 authorize;
26
15
  # };
27
16
  #
28
17
  # ===========================================================================
29
18
  module Stellar
30
19
  class AllowTrustOp < XDR::Struct
31
- include XDR::Namespace
32
-
33
- autoload :Asset
34
-
35
20
  attribute :trustor, AccountID
36
- attribute :asset, Asset
21
+ attribute :asset, AssetCode
37
22
  attribute :authorize, Uint32
38
23
  end
39
24
  end
@@ -15,7 +15,9 @@ require 'xdr'
15
15
  # // source account does not require trust
16
16
  # ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
17
17
  # ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust,
18
- # ALLOW_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
18
+ # ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed
19
+ # ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created
20
+ # // on revoke due to low reserves
19
21
  # };
20
22
  #
21
23
  # ===========================================================================
@@ -27,6 +29,7 @@ module Stellar
27
29
  member :allow_trust_trust_not_required, -3
28
30
  member :allow_trust_cant_revoke, -4
29
31
  member :allow_trust_self_not_allowed, -5
32
+ member :allow_trust_low_reserve, -6
30
33
 
31
34
  seal
32
35
  end
@@ -0,0 +1,20 @@
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 AlphaNum12
9
+ # {
10
+ # AssetCode12 assetCode;
11
+ # AccountID issuer;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class AlphaNum12 < XDR::Struct
17
+ attribute :asset_code, AssetCode12
18
+ attribute :issuer, AccountID
19
+ end
20
+ end
@@ -0,0 +1,20 @@
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 AlphaNum4
9
+ # {
10
+ # AssetCode4 assetCode;
11
+ # AccountID issuer;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class AlphaNum4 < XDR::Struct
17
+ attribute :asset_code, AssetCode4
18
+ attribute :issuer, AccountID
19
+ end
20
+ end
@@ -11,18 +11,10 @@ require 'xdr'
11
11
  # void;
12
12
  #
13
13
  # case ASSET_TYPE_CREDIT_ALPHANUM4:
14
- # struct
15
- # {
16
- # AssetCode4 assetCode;
17
- # AccountID issuer;
18
- # } alphaNum4;
14
+ # AlphaNum4 alphaNum4;
19
15
  #
20
16
  # case ASSET_TYPE_CREDIT_ALPHANUM12:
21
- # struct
22
- # {
23
- # AssetCode12 assetCode;
24
- # AccountID issuer;
25
- # } alphaNum12;
17
+ # AlphaNum12 alphaNum12;
26
18
  #
27
19
  # // add other asset types here in the future
28
20
  # };
@@ -30,11 +22,6 @@ require 'xdr'
30
22
  # ===========================================================================
31
23
  module Stellar
32
24
  class Asset < XDR::Union
33
- include XDR::Namespace
34
-
35
- autoload :AlphaNum4
36
- autoload :AlphaNum12
37
-
38
25
  switch_on AssetType, :type
39
26
 
40
27
  switch :asset_type_native
@@ -0,0 +1,30 @@
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
+ # union AssetCode switch (AssetType type)
9
+ # {
10
+ # case ASSET_TYPE_CREDIT_ALPHANUM4:
11
+ # AssetCode4 assetCode4;
12
+ #
13
+ # case ASSET_TYPE_CREDIT_ALPHANUM12:
14
+ # AssetCode12 assetCode12;
15
+ #
16
+ # // add other asset types here in the future
17
+ # };
18
+ #
19
+ # ===========================================================================
20
+ module Stellar
21
+ class AssetCode < XDR::Union
22
+ switch_on AssetType, :type
23
+
24
+ switch :asset_type_credit_alphanum4, :asset_code4
25
+ switch :asset_type_credit_alphanum12, :asset_code12
26
+
27
+ attribute :asset_code4, AssetCode4
28
+ attribute :asset_code12, AssetCode12
29
+ end
30
+ end
@@ -9,7 +9,8 @@ require 'xdr'
9
9
  # {
10
10
  # ASSET_TYPE_NATIVE = 0,
11
11
  # ASSET_TYPE_CREDIT_ALPHANUM4 = 1,
12
- # ASSET_TYPE_CREDIT_ALPHANUM12 = 2
12
+ # ASSET_TYPE_CREDIT_ALPHANUM12 = 2,
13
+ # ASSET_TYPE_POOL_SHARE = 3
13
14
  # };
14
15
  #
15
16
  # ===========================================================================
@@ -18,6 +19,7 @@ module Stellar
18
19
  member :asset_type_native, 0
19
20
  member :asset_type_credit_alphanum4, 1
20
21
  member :asset_type_credit_alphanum12, 2
22
+ member :asset_type_pool_share, 3
21
23
 
22
24
  seal
23
25
  end
@@ -5,7 +5,8 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # union BeginSponsoringFutureReservesResult switch (BeginSponsoringFutureReservesResultCode code)
8
+ # union BeginSponsoringFutureReservesResult switch (
9
+ # BeginSponsoringFutureReservesResultCode code)
9
10
  # {
10
11
  # case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
11
12
  # void;
@@ -0,0 +1,39 @@
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
+ # union ChangeTrustAsset switch (AssetType type)
9
+ # {
10
+ # case ASSET_TYPE_NATIVE: // Not credit
11
+ # void;
12
+ #
13
+ # case ASSET_TYPE_CREDIT_ALPHANUM4:
14
+ # AlphaNum4 alphaNum4;
15
+ #
16
+ # case ASSET_TYPE_CREDIT_ALPHANUM12:
17
+ # AlphaNum12 alphaNum12;
18
+ #
19
+ # case ASSET_TYPE_POOL_SHARE:
20
+ # LiquidityPoolParameters liquidityPool;
21
+ #
22
+ # // add other asset types here in the future
23
+ # };
24
+ #
25
+ # ===========================================================================
26
+ module Stellar
27
+ class ChangeTrustAsset < XDR::Union
28
+ switch_on AssetType, :type
29
+
30
+ switch :asset_type_native
31
+ switch :asset_type_credit_alphanum4, :alpha_num4
32
+ switch :asset_type_credit_alphanum12, :alpha_num12
33
+ switch :asset_type_pool_share, :liquidity_pool
34
+
35
+ attribute :alpha_num4, AlphaNum4
36
+ attribute :alpha_num12, AlphaNum12
37
+ attribute :liquidity_pool, LiquidityPoolParameters
38
+ end
39
+ end
@@ -7,7 +7,7 @@ require 'xdr'
7
7
  #
8
8
  # struct ChangeTrustOp
9
9
  # {
10
- # Asset line;
10
+ # ChangeTrustAsset line;
11
11
  #
12
12
  # // if limit is set to 0, deletes the trust line
13
13
  # int64 limit;
@@ -16,7 +16,7 @@ require 'xdr'
16
16
  # ===========================================================================
17
17
  module Stellar
18
18
  class ChangeTrustOp < XDR::Struct
19
- attribute :line, Asset
19
+ attribute :line, ChangeTrustAsset
20
20
  attribute :limit, Int64
21
21
  end
22
22
  end
@@ -16,18 +16,24 @@ require 'xdr'
16
16
  # // cannot create with a limit of 0
17
17
  # CHANGE_TRUST_LOW_RESERVE =
18
18
  # -4, // not enough funds to create a new trust line,
19
- # CHANGE_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
19
+ # CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed
20
+ # CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool
21
+ # CHANGE_TRUST_CANNOT_DELETE = -7, // Asset trustline is still referenced in a pool
22
+ # CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -8 // Asset trustline is deauthorized
20
23
  # };
21
24
  #
22
25
  # ===========================================================================
23
26
  module Stellar
24
27
  class ChangeTrustResultCode < XDR::Enum
25
- member :change_trust_success, 0
26
- member :change_trust_malformed, -1
27
- member :change_trust_no_issuer, -2
28
- member :change_trust_invalid_limit, -3
29
- member :change_trust_low_reserve, -4
30
- member :change_trust_self_not_allowed, -5
28
+ member :change_trust_success, 0
29
+ member :change_trust_malformed, -1
30
+ member :change_trust_no_issuer, -2
31
+ member :change_trust_invalid_limit, -3
32
+ member :change_trust_low_reserve, -4
33
+ member :change_trust_self_not_allowed, -5
34
+ member :change_trust_trust_line_missing, -6
35
+ member :change_trust_cannot_delete, -7
36
+ member :change_trust_not_auth_maintain_liabilities, -8
31
37
 
32
38
  seal
33
39
  end
@@ -0,0 +1,31 @@
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
+ # union ClaimAtom switch (ClaimAtomType type)
9
+ # {
10
+ # case CLAIM_ATOM_TYPE_V0:
11
+ # ClaimOfferAtomV0 v0;
12
+ # case CLAIM_ATOM_TYPE_ORDER_BOOK:
13
+ # ClaimOfferAtom orderBook;
14
+ # case CLAIM_ATOM_TYPE_LIQUIDITY_POOL:
15
+ # ClaimLiquidityAtom liquidityPool;
16
+ # };
17
+ #
18
+ # ===========================================================================
19
+ module Stellar
20
+ class ClaimAtom < XDR::Union
21
+ switch_on ClaimAtomType, :type
22
+
23
+ switch :claim_atom_type_v0, :v0
24
+ switch :claim_atom_type_order_book, :order_book
25
+ switch :claim_atom_type_liquidity_pool, :liquidity_pool
26
+
27
+ attribute :v0, ClaimOfferAtomV0
28
+ attribute :order_book, ClaimOfferAtom
29
+ attribute :liquidity_pool, ClaimLiquidityAtom
30
+ end
31
+ end
@@ -0,0 +1,24 @@
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
+ # enum ClaimAtomType
9
+ # {
10
+ # CLAIM_ATOM_TYPE_V0 = 0,
11
+ # CLAIM_ATOM_TYPE_ORDER_BOOK = 1,
12
+ # CLAIM_ATOM_TYPE_LIQUIDITY_POOL = 2
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class ClaimAtomType < XDR::Enum
18
+ member :claim_atom_type_v0, 0
19
+ member :claim_atom_type_order_book, 1
20
+ member :claim_atom_type_liquidity_pool, 2
21
+
22
+ seal
23
+ end
24
+ end