stellar-base 0.23.1 → 0.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +134 -29
- data/README.md +7 -7
- data/generated/stellar-base-generated.rb +44 -1
- data/generated/stellar/account_entry.rb +3 -13
- data/generated/stellar/account_entry/ext.rb +2 -16
- data/generated/stellar/account_entry_extension_v1.rb +32 -0
- data/generated/stellar/account_entry_extension_v1/ext.rb +28 -0
- data/generated/stellar/account_entry_extension_v2.rb +34 -0
- data/generated/stellar/{account_entry/ext/v1 → account_entry_extension_v2}/ext.rb +8 -12
- data/generated/stellar/account_flags.rb +9 -4
- data/generated/stellar/account_merge_result.rb +1 -1
- data/generated/stellar/account_merge_result_code.rb +3 -1
- data/generated/stellar/allow_trust_op.rb +3 -18
- data/generated/stellar/asset_code.rb +30 -0
- data/generated/stellar/begin_sponsoring_future_reserves_op.rb +18 -0
- data/generated/stellar/begin_sponsoring_future_reserves_result.rb +26 -0
- data/generated/stellar/begin_sponsoring_future_reserves_result_code.rb +29 -0
- data/generated/stellar/claim_claimable_balance_op.rb +18 -0
- data/generated/stellar/claim_claimable_balance_result.rb +25 -0
- data/generated/stellar/claim_claimable_balance_result_code.rb +31 -0
- data/generated/stellar/claim_predicate.rb +43 -0
- data/generated/stellar/claim_predicate_type.rb +30 -0
- data/generated/stellar/claimable_balance_entry.rb +46 -0
- data/generated/stellar/claimable_balance_entry/ext.rb +28 -0
- data/generated/stellar/claimable_balance_entry_extension_v1.rb +30 -0
- data/generated/stellar/claimable_balance_entry_extension_v1/ext.rb +24 -0
- data/generated/stellar/claimable_balance_flags.rb +22 -0
- data/generated/stellar/claimable_balance_id.rb +23 -0
- data/generated/stellar/claimable_balance_id_type.rb +20 -0
- data/generated/stellar/claimant.rb +31 -0
- data/generated/stellar/claimant/v0.rb +22 -0
- data/generated/stellar/claimant_type.rb +20 -0
- data/generated/stellar/clawback_claimable_balance_op.rb +18 -0
- data/generated/stellar/clawback_claimable_balance_result.rb +26 -0
- data/generated/stellar/clawback_claimable_balance_result_code.rb +29 -0
- data/generated/stellar/clawback_op.rb +22 -0
- data/generated/stellar/clawback_result.rb +25 -0
- data/generated/stellar/clawback_result_code.rb +31 -0
- data/generated/stellar/create_claimable_balance_op.rb +22 -0
- data/generated/stellar/create_claimable_balance_result.rb +27 -0
- data/generated/stellar/create_claimable_balance_result_code.rb +30 -0
- data/generated/stellar/create_passive_sell_offer_op.rb +1 -1
- data/generated/stellar/end_sponsoring_future_reserves_result.rb +26 -0
- data/generated/stellar/end_sponsoring_future_reserves_result_code.rb +25 -0
- data/generated/stellar/envelope_type.rb +3 -1
- data/generated/stellar/inner_transaction_result.rb +2 -1
- data/generated/stellar/inner_transaction_result/result.rb +3 -1
- data/generated/stellar/ledger_entry.rb +4 -0
- data/generated/stellar/ledger_entry/data.rb +12 -8
- data/generated/stellar/ledger_entry/ext.rb +4 -0
- data/generated/stellar/ledger_entry_extension_v1.rb +30 -0
- data/generated/stellar/ledger_entry_extension_v1/ext.rb +24 -0
- data/generated/stellar/ledger_entry_type.rb +7 -5
- data/generated/stellar/ledger_key.rb +17 -8
- data/generated/stellar/ledger_key/claimable_balance.rb +20 -0
- data/generated/stellar/operation.rb +16 -0
- data/generated/stellar/operation/body.rb +57 -26
- data/generated/stellar/operation_id.rb +32 -0
- data/generated/stellar/operation_id/id.rb +24 -0
- data/generated/stellar/operation_result.rb +16 -0
- data/generated/stellar/operation_result/tr.rb +60 -28
- data/generated/stellar/operation_result_code.rb +3 -1
- data/generated/stellar/operation_type.rb +31 -15
- data/generated/stellar/path_payment_strict_receive_result.rb +2 -1
- data/generated/stellar/payment_result_code.rb +1 -1
- data/generated/stellar/revoke_sponsorship_op.rb +35 -0
- data/generated/stellar/revoke_sponsorship_op/signer.rb +22 -0
- data/generated/stellar/revoke_sponsorship_result.rb +25 -0
- data/generated/stellar/revoke_sponsorship_result_code.rb +31 -0
- data/generated/stellar/revoke_sponsorship_type.rb +22 -0
- data/generated/stellar/set_options_result_code.rb +14 -11
- data/generated/stellar/set_trust_line_flags_op.rb +25 -0
- data/generated/stellar/set_trust_line_flags_result.rb +25 -0
- data/generated/stellar/set_trust_line_flags_result_code.rb +31 -0
- data/generated/stellar/transaction_result_code.rb +5 -3
- data/generated/stellar/trust_line_flags.rb +5 -1
- data/lib/stellar-base.rb +18 -5
- data/lib/stellar/account_flags.rb +1 -1
- data/lib/stellar/asset.rb +10 -0
- data/lib/stellar/claim_predicate.rb +198 -0
- data/lib/stellar/compat.rb +4 -16
- data/lib/stellar/concerns/transaction.rb +5 -4
- data/lib/stellar/dsl.rb +93 -0
- data/lib/stellar/ext/xdr.rb +50 -0
- data/lib/stellar/key_pair.rb +60 -53
- data/lib/stellar/ledger_key.rb +32 -0
- data/lib/stellar/muxed_account.rb +16 -0
- data/lib/stellar/networks.rb +12 -12
- data/lib/stellar/operation.rb +144 -17
- data/lib/stellar/price.rb +11 -2
- data/lib/stellar/transaction.rb +1 -169
- data/lib/stellar/transaction_builder.rb +28 -2
- data/lib/stellar/transaction_envelope.rb +7 -43
- data/lib/stellar/transaction_v0.rb +2 -10
- data/lib/stellar/trust_line_flags.rb +53 -0
- data/lib/stellar/util/strkey.rb +6 -6
- data/lib/stellar/version.rb +1 -3
- metadata +177 -30
- data/generated/stellar/account_entry/ext/v1.rb +0 -34
- data/generated/stellar/allow_trust_op/asset.rb +0 -33
- data/lib/stellar/util/continued_fraction.rb +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3f2262b18e995857495f0209dff368bf75d5ca0fb946a77c890a859e816f916
|
4
|
+
data.tar.gz: ef32817bb66be06efe55f7da2ef204837895f4f6966c4fd55b91e2f1bbff8bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6a82d8306b2c62d57b4467fcbfef426d276b7c11612dfed13fb2db13b43c6aa9091f7cfd1c7d6c464b3d93f6faf7d72b7262fdfd9d6dc9dfb7ca7557c9b5254
|
7
|
+
data.tar.gz: ab279d7660378ed94d5d1fdfd2367714c10d78bd7f109dba50dafbcd186de0de97de0893b4b50620029a9189a0ad5d0e98604769ec4a4b0e82c1ceaa8c99278a
|
data/CHANGELOG.md
CHANGED
@@ -1,38 +1,143 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this
|
4
|
-
file.
|
4
|
+
file. The format is based on [Keep a Changelog](https://keepachangelog.com/)
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
5
6
|
|
6
7
|
As this project is pre 1.0, breaking changes may happen for minor version
|
7
8
|
bumps. A breaking change will get clearly notified in this log.
|
8
9
|
|
9
|
-
## [0.
|
10
|
+
## [0.27.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.26.0...v0.27.0) (2021-05-08)
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* **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))
|
15
|
+
|
16
|
+
## [0.26.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.25.0...v0.26.0) - 2021-02-05
|
17
|
+
- No changes
|
18
|
+
|
19
|
+
## [0.25.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.24.0...v0.25.0) - 2020-10-30
|
20
|
+
### Added
|
21
|
+
- `MuxedAccount` implements `#to_keypair` conversion protocol
|
22
|
+
- `MuxedAccount` correctly responds to `#address` with strkey encoded public key
|
23
|
+
### Fixed
|
24
|
+
- `Transaction::V0#source_account` now properly returns `MuxedAccount` instead of raw bytes
|
25
|
+
|
26
|
+
## [0.24.0](https://github.com/astroband/ruby-stellar-sdk/compare/v0.23.1...v0.24.0) - 2020-10-20
|
27
|
+
### Added
|
28
|
+
- Add conversion methods for KeyPair and Asset
|
29
|
+
- Stellar Protocol 14 support
|
30
|
+
- Regenerate XDR wrappers from definitions in stellar-core 14.1.1
|
31
|
+
- Add [CAP-23 Two-Part Payments](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0023.md) support
|
32
|
+
- Add ClaimPredicate DSL methods which help with creation of claim predicates.
|
33
|
+
```ruby
|
34
|
+
# use class-level helpers to create simple predicates
|
35
|
+
unconditional = Stellar::ClaimPredicate.unconditional
|
36
|
+
before_rel_time = Stellar::ClaimPredicate.before_relative_time(1.hour)
|
37
|
+
before_abs_time = Stellar::ClaimPredicate.before_absolute_time(Date.tomorrow.beginning_of_day)
|
38
|
+
|
39
|
+
# negate predicates using `~` unary operator
|
40
|
+
~predicate # same as predicate.not
|
41
|
+
|
42
|
+
# build complex predicates using `&` and `|` infix operators
|
43
|
+
predicate & other_predicate # same as `predicate.and(other_predicate)`
|
44
|
+
predicate | other_predicate # same as `predicate.or(other_predicate)`
|
45
|
+
|
46
|
+
# quickly define complex predicates using `.compose` class method with the block
|
47
|
+
unconditional = Stellar::ClaimPredicate.compose { }
|
48
|
+
complex = Stellar::ClaimPredicate.compose do
|
49
|
+
before_relative_time(1.week) & ~before_relative_time(10.seconds) |
|
50
|
+
end
|
51
|
+
|
52
|
+
# here's what building this predicate would look like without DSL
|
53
|
+
complex = Stellar::ClaimPredicate.new(
|
54
|
+
Stellar::ClaimPredicateType::AND,
|
55
|
+
Stellar::ClaimPredicate.new(
|
56
|
+
Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 7 * 24 * 60 * 60
|
57
|
+
),
|
58
|
+
Stellar::ClaimPredicate.new(
|
59
|
+
Stellar::ClaimPredicateType::NOT, Stellar::ClaimPredicate.new(
|
60
|
+
Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 10
|
61
|
+
)
|
62
|
+
)
|
63
|
+
)
|
64
|
+
|
65
|
+
```
|
66
|
+
- Extend Operation with `create_claimable_balance` and `claim_claimable_balance` helpers
|
67
|
+
- Add Claimant and ClaimPredicate DSL methods to reduce the noise.
|
68
|
+
```ruby
|
69
|
+
include Stellar::DSL
|
70
|
+
|
71
|
+
sender = KeyPair('S....')
|
72
|
+
recipient = 'G....'
|
73
|
+
|
74
|
+
op = Operation.create_claimable_balance(
|
75
|
+
asset: Stellar::Asset.native,
|
76
|
+
amount: 100,
|
77
|
+
claimants: [
|
78
|
+
Claimant(recipient) { after(10.seconds) & before(1.week) },
|
79
|
+
Claimant(sender), # allow unconditional claim-back
|
80
|
+
]
|
81
|
+
)
|
82
|
+
])
|
83
|
+
```
|
84
|
+
- Add simple predicate evaluation feature so that developers can sanity-check their predicates
|
85
|
+
```ruby
|
86
|
+
include Stellar::DSL
|
87
|
+
|
88
|
+
predicate = ClaimPredicate { before_relative_time(1.week) & ~before_relative_time(10.seconds) }
|
89
|
+
|
90
|
+
# predicate.evaluate(balance_creation_time, claim_evaluation_time)
|
91
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:00:05") # => false
|
92
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:01:00") # => true
|
93
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 08:50:00") # => true
|
94
|
+
|
95
|
+
# you can also pass an instance of ActiveSupport::Duration as a second parameter, in this case
|
96
|
+
# it works as a relative offset from `balance_creation_time`
|
97
|
+
predicate.evaluate("2020-10-20 09:00:00", 1.week + 1.second) # => false
|
98
|
+
|
99
|
+
# it is effectively the same as
|
100
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 09:00:01") # => false
|
101
|
+
```
|
102
|
+
- Add [CAP-33 Sponsored Reserves](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0033.md) support
|
103
|
+
- Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
|
104
|
+
- `Operation.begin_sponsoring_future_reserves`
|
105
|
+
- `Operation.end_sponsoring_future_reserves`
|
106
|
+
- `Operation.revoke_sponsorship(account_id:)`
|
107
|
+
- `Operation.revoke_sponsorship(account_id:, asset:)`
|
108
|
+
- `Operation.revoke_sponsorship(account_id:, offer_id:)`
|
109
|
+
- `Operation.revoke_sponsorship(account_id:, data_name:)`
|
110
|
+
- `Operation.revoke_sponsorship(account_id:, balance_id:)`
|
111
|
+
- `Operation.revoke_sponsorship(account_id:, signer:)`
|
112
|
+
|
113
|
+
|
114
|
+
## [0.23.1](https://github.com/astroband/ruby-stellar-sdk/compare/v0.23.0...v0.23.1) - 2020-06-18
|
10
115
|
### Added
|
11
116
|
- Transaction builder now builds V1 transactions
|
12
117
|
- FeeBumpTransaction can wrap V0 transaction
|
13
|
-
|
14
|
-
## [0.23.0](https://github.com/
|
118
|
+
|
119
|
+
## [0.23.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.22.0...v0.23.0) - 2020-06-11
|
15
120
|
### Added
|
16
121
|
- Stellar Protocol 13 support
|
17
122
|
- Fee-Bump transactions ([CAP-0015](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md))
|
18
123
|
- Multiplexed accounts ([CAP-0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md))
|
19
124
|
- Fine-Grained control on trustline authorization ([CAP-0018](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0018.md))
|
20
|
-
|
21
|
-
## [0.22.0](https://github.com/
|
125
|
+
|
126
|
+
## [0.22.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.21.0...base-v0.22.0) - 2020-03-26
|
22
127
|
### Added
|
23
|
-
- Add TransactionBuilder ([#54](https://github.com/
|
128
|
+
- Add TransactionBuilder ([#54](https://github.com/astroband/ruby-stellar-base/issues/54))
|
24
129
|
|
25
130
|
### Changed
|
26
|
-
- Regenerate XDR files ([#57](https://github.com/
|
27
|
-
- Allow asset objects to be passed instead of list of parameters ([#59](https://github.com/
|
131
|
+
- Regenerate XDR files ([#57](https://github.com/astroband/ruby-stellar-base/issues/57))
|
132
|
+
- Allow asset objects to be passed instead of list of parameters ([#59](https://github.com/astroband/ruby-stellar-base/issues/59))
|
28
133
|
|
29
|
-
## [0.21.0](https://github.com/
|
134
|
+
## [0.21.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.20.0...base-v0.21.0) - 2019-10-04
|
30
135
|
### Changed
|
31
|
-
- [Stellar Protocol 12 compatibility](https://github.com/
|
136
|
+
- [Stellar Protocol 12 compatibility](https://github.com/astroband/ruby-stellar-base/pull/51).
|
32
137
|
- XDR changes for path payment
|
33
138
|
- constant renames, which may cause breaking changes if referred to directly
|
34
139
|
|
35
|
-
## [0.20.0](https://github.com/
|
140
|
+
## [0.20.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.19.0...base-v0.20.0) - 2019-05-22
|
36
141
|
### Added
|
37
142
|
- Stellar Protocol 11 compatibility (#48)
|
38
143
|
- XDR changes for [CAP-0006 Buy Offers](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0006.md)
|
@@ -43,11 +148,11 @@ bumps. A breaking change will get clearly notified in this log.
|
|
43
148
|
- Deprecate `manage_offer` and `create_passive_offer` factory methods in `Stellar::Transaction` and `Stellar::Operation`
|
44
149
|
- Add an option to pass the exact stellar-core revision into `xdr:update` Rake task
|
45
150
|
|
46
|
-
## [0.19.0](https://github.com/
|
151
|
+
## [0.19.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.18.0...base-v0.19.0)
|
47
152
|
### Changed
|
48
153
|
- Loosen ActiveSupport to >= 5.0.0
|
49
154
|
|
50
|
-
## [0.18.0](https://github.com/
|
155
|
+
## [0.18.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.17.0...base-v0.18.0)
|
51
156
|
### Added
|
52
157
|
- 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))
|
53
158
|
- Add factories for ledger, transaction, operation.
|
@@ -55,11 +160,11 @@ bumps. A breaking change will get clearly notified in this log.
|
|
55
160
|
### Changed
|
56
161
|
- Use rbnacl instead of rbnacl-libsodium (the latter has been [deprecated](https://github.com/crypto-rb/rbnacl-libsodium/issues/29))
|
57
162
|
|
58
|
-
## [0.17.0](https://github.com/
|
163
|
+
## [0.17.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.16.0...base-v0.17.0)
|
59
164
|
### Fixed
|
60
165
|
- Rename `Stellar::SignerKey#onetime_signer` helper to `Stellar::SignerKey#hash_x`, add preimage validations
|
61
166
|
|
62
|
-
## [0.16.0](https://github.com/
|
167
|
+
## [0.16.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.15.0...base-v0.16.0)
|
63
168
|
### Added
|
64
169
|
- Create co-signers conveniently using helpers `ed25519(keypair)`, `preauthorized_transaction(tx)` and `onetime_signer(preimage)` from `Stellar::SignerKey` module
|
65
170
|
- Merge two transactions with `Stellar::TransactionEnvelope#merge`
|
@@ -67,14 +172,14 @@ bumps. A breaking change will get clearly notified in this log.
|
|
67
172
|
### Fixed
|
68
173
|
- Source account overriding in Stellar::Transaction#to_operations
|
69
174
|
|
70
|
-
## [0.15.0](https://github.com/
|
175
|
+
## [0.15.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.14.0...base-v0.15.0)
|
71
176
|
### Added
|
72
177
|
- `Stellar::Operation.change_trust` can accept `Stellar::Asset` instance for `line`
|
73
178
|
|
74
179
|
### Fixed
|
75
180
|
- Protect `Stellar::Operation.change_trust` against malicious arguments, in the event that developers pass this argument directly from user input
|
76
181
|
|
77
|
-
## [0.14.0](https://github.com/
|
182
|
+
## [0.14.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.13.0...base-v0.14.0)
|
78
183
|
|
79
184
|
### Added
|
80
185
|
- We now support the bump sequence operation with `Operation.bump_sequence`.
|
@@ -84,7 +189,7 @@ bumps. A breaking change will get clearly notified in this log.
|
|
84
189
|
- `Operation.change_trust` learned how to use a default for the `:limit` parameter
|
85
190
|
- `StrKey` learned about new version bytes `pre_auth_tx` and `hash_x`
|
86
191
|
|
87
|
-
## [0.13.0](https://github.com/
|
192
|
+
## [0.13.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.12.0...base-v0.13.0)
|
88
193
|
|
89
194
|
### Changed
|
90
195
|
- Update XDR definitions for stellar-core 0.9.1 support
|
@@ -92,7 +197,7 @@ bumps. A breaking change will get clearly notified in this log.
|
|
92
197
|
### Added
|
93
198
|
- Added `#signer_key` helper to `KeyPair`
|
94
199
|
|
95
|
-
## [0.12.0](https://github.com/
|
200
|
+
## [0.12.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.11.0...base-v0.12.0)
|
96
201
|
|
97
202
|
### Changed
|
98
203
|
- Avoid modifying $LOAD_PATH to fix load order issues
|
@@ -102,7 +207,7 @@ bumps. A breaking change will get clearly notified in this log.
|
|
102
207
|
|
103
208
|
- BREAKING CHANGE: Removed support for JRuby.
|
104
209
|
|
105
|
-
## [0.11.0](https://github.com/
|
210
|
+
## [0.11.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.10.0...base-v0.11.0)
|
106
211
|
|
107
212
|
### Added
|
108
213
|
- Added support for `manage_data` operations
|
@@ -110,48 +215,48 @@ bumps. A breaking change will get clearly notified in this log.
|
|
110
215
|
### Changed
|
111
216
|
- `Stellar::Transaction#to_envelope` can now be used without arguments, returning a `Stellar::TransactionEnvelope` with zero signatures.
|
112
217
|
|
113
|
-
## [0.10.0](https://github.com/
|
218
|
+
## [0.10.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.9.0...base-v0.10.0)
|
114
219
|
|
115
220
|
- 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.
|
116
221
|
|
117
|
-
## [0.9.0](https://github.com/
|
222
|
+
## [0.9.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.8.0...base-v0.9.0)
|
118
223
|
|
119
224
|
### Changed
|
120
225
|
- XDR Definitions have been updated to stellar-core commit eed89649c2060b8e9dacffe2cec4e8b258b32416
|
121
226
|
|
122
|
-
## [0.8.0](https://github.com/
|
227
|
+
## [0.8.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.7.0...base-v0.8.0)
|
123
228
|
|
124
229
|
### Changed
|
125
230
|
- BREAKING CHANGE: The default network for this library is now the stellar test network.
|
126
231
|
To enable this library for the production network use `Stellar.default_network = Stellar::Networks::PUBLIC`
|
127
232
|
at the head of your script or in your configuration function.
|
128
233
|
|
129
|
-
## [0.7.0](https://github.com/
|
234
|
+
## [0.7.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.6.1...base-v0.7.0)
|
130
235
|
|
131
236
|
### Changed
|
132
237
|
|
133
238
|
- Bump xdr dependency to 1.0.0
|
134
239
|
|
135
|
-
## [0.6.1](https://github.com/
|
240
|
+
## [0.6.1](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.6.0...base-v0.6.1)
|
136
241
|
|
137
242
|
### Changed
|
138
243
|
|
139
244
|
- Update default fee for transactions to new minimum of 100 stroops
|
140
245
|
|
141
246
|
|
142
|
-
## [0.6.0](https://github.com/
|
247
|
+
## [0.6.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.5.0...base-v0.6.0)
|
143
248
|
|
144
249
|
### Changed
|
145
250
|
|
146
251
|
- Update to latest xdr (stellar-core commit ad22bccafbbc14a358f05a989f7b95714dc9d4c6)
|
147
252
|
|
148
|
-
## [0.5.0](https://github.com/
|
253
|
+
## [0.5.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.4.0...base-v0.5.0)
|
149
254
|
|
150
255
|
### Changed
|
151
256
|
|
152
257
|
- Update to latest xdr
|
153
258
|
|
154
|
-
## [0.4.0](https://github.com/
|
259
|
+
## [0.4.0](https://github.com/astroband/ruby-stellar-sdk/compare/base-v0.3.0...base-v0.4.0)
|
155
260
|
|
156
261
|
### Changed
|
157
262
|
- BREAKING CHANGE: "Amounts", that is, input parameters that represent a
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Stellar
|
2
|
-
|
3
|
-
[![
|
4
|
-
[![
|
1
|
+
# Stellar SDK for Ruby: XDR and Low Level Abstractions
|
2
|
+
[![stellar-base](https://badge.fury.io/rb/stellar-base.svg)](https://badge.fury.io/rb/stellar-base)
|
3
|
+
[![Test](https://github.com/astroband/ruby-stellar-sdk/workflows/Test/badge.svg)](https://github.com/astroband/ruby-stellar-sdk/actions?query=branch%3Amaster)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/dadfcd9396aba493cb93/maintainability)](https://codeclimate.com/github/astroband/ruby-stellar-sdk/maintainability)
|
5
5
|
|
6
6
|
The stellar-base library is the lowest-level stellar helper library. It consists of classes
|
7
7
|
to read, write, hash, and sign the xdr structures that are used in stellard.
|
@@ -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 [
|
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/
|
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).
|
@@ -38,6 +38,7 @@ module Stellar
|
|
38
38
|
AssetCode4 = XDR::Opaque[4]
|
39
39
|
AssetCode12 = XDR::Opaque[12]
|
40
40
|
autoload :AssetType
|
41
|
+
autoload :AssetCode
|
41
42
|
autoload :Asset
|
42
43
|
autoload :Price
|
43
44
|
autoload :Liabilities
|
@@ -46,16 +47,34 @@ module Stellar
|
|
46
47
|
autoload :Signer
|
47
48
|
autoload :AccountFlags
|
48
49
|
MASK_ACCOUNT_FLAGS = 0x7
|
50
|
+
MASK_ACCOUNT_FLAGS_V17 = 0xF
|
51
|
+
MAX_SIGNERS = 20
|
52
|
+
SponsorshipDescriptor = XDR::Option[AccountID]
|
53
|
+
autoload :AccountEntryExtensionV2
|
54
|
+
autoload :AccountEntryExtensionV1
|
49
55
|
autoload :AccountEntry
|
50
56
|
autoload :TrustLineFlags
|
51
57
|
MASK_TRUSTLINE_FLAGS = 1
|
52
58
|
MASK_TRUSTLINE_FLAGS_V13 = 3
|
59
|
+
MASK_TRUSTLINE_FLAGS_V17 = 7
|
53
60
|
autoload :TrustLineEntry
|
54
61
|
autoload :OfferEntryFlags
|
55
62
|
MASK_OFFERENTRY_FLAGS = 1
|
56
63
|
autoload :OfferEntry
|
57
64
|
autoload :DataEntry
|
65
|
+
autoload :ClaimPredicateType
|
66
|
+
autoload :ClaimPredicate
|
67
|
+
autoload :ClaimantType
|
68
|
+
autoload :Claimant
|
69
|
+
autoload :ClaimableBalanceIDType
|
70
|
+
autoload :ClaimableBalanceID
|
71
|
+
autoload :ClaimableBalanceFlags
|
72
|
+
MASK_CLAIMABLE_BALANCE_FLAGS = 0x1
|
73
|
+
autoload :ClaimableBalanceEntryExtensionV1
|
74
|
+
autoload :ClaimableBalanceEntry
|
75
|
+
autoload :LedgerEntryExtensionV1
|
58
76
|
autoload :LedgerEntry
|
77
|
+
autoload :LedgerKey
|
59
78
|
autoload :EnvelopeType
|
60
79
|
end
|
61
80
|
module Stellar
|
@@ -76,7 +95,16 @@ module Stellar
|
|
76
95
|
autoload :AllowTrustOp
|
77
96
|
autoload :ManageDataOp
|
78
97
|
autoload :BumpSequenceOp
|
98
|
+
autoload :CreateClaimableBalanceOp
|
99
|
+
autoload :ClaimClaimableBalanceOp
|
100
|
+
autoload :BeginSponsoringFutureReservesOp
|
101
|
+
autoload :RevokeSponsorshipType
|
102
|
+
autoload :RevokeSponsorshipOp
|
103
|
+
autoload :ClawbackOp
|
104
|
+
autoload :ClawbackClaimableBalanceOp
|
105
|
+
autoload :SetTrustLineFlagsOp
|
79
106
|
autoload :Operation
|
107
|
+
autoload :OperationID
|
80
108
|
autoload :MemoType
|
81
109
|
autoload :Memo
|
82
110
|
autoload :TimeBounds
|
@@ -120,6 +148,22 @@ module Stellar
|
|
120
148
|
autoload :ManageDataResult
|
121
149
|
autoload :BumpSequenceResultCode
|
122
150
|
autoload :BumpSequenceResult
|
151
|
+
autoload :CreateClaimableBalanceResultCode
|
152
|
+
autoload :CreateClaimableBalanceResult
|
153
|
+
autoload :ClaimClaimableBalanceResultCode
|
154
|
+
autoload :ClaimClaimableBalanceResult
|
155
|
+
autoload :BeginSponsoringFutureReservesResultCode
|
156
|
+
autoload :BeginSponsoringFutureReservesResult
|
157
|
+
autoload :EndSponsoringFutureReservesResultCode
|
158
|
+
autoload :EndSponsoringFutureReservesResult
|
159
|
+
autoload :RevokeSponsorshipResultCode
|
160
|
+
autoload :RevokeSponsorshipResult
|
161
|
+
autoload :ClawbackResultCode
|
162
|
+
autoload :ClawbackResult
|
163
|
+
autoload :ClawbackClaimableBalanceResultCode
|
164
|
+
autoload :ClawbackClaimableBalanceResult
|
165
|
+
autoload :SetTrustLineFlagsResultCode
|
166
|
+
autoload :SetTrustLineFlagsResult
|
123
167
|
autoload :OperationResultCode
|
124
168
|
autoload :OperationResult
|
125
169
|
autoload :TransactionResultCode
|
@@ -137,7 +181,6 @@ module Stellar
|
|
137
181
|
autoload :LedgerHeader
|
138
182
|
autoload :LedgerUpgradeType
|
139
183
|
autoload :LedgerUpgrade
|
140
|
-
autoload :LedgerKey
|
141
184
|
autoload :BucketEntryType
|
142
185
|
autoload :BucketMetadata
|
143
186
|
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<
|
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
|
-
#
|
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,
|
52
|
+
attribute :signers, XDR::VarArray[Signer, MAX_SIGNERS]
|
63
53
|
attribute :ext, Ext
|
64
54
|
end
|
65
55
|
end
|