stellar-base 0.23.0 → 0.26.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +114 -1
- data/README.md +4 -7
- data/generated/stellar-base-generated.rb +29 -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_merge_result_code.rb +3 -1
- data/generated/stellar/begin_sponsoring_future_reserves_op.rb +18 -0
- data/generated/stellar/begin_sponsoring_future_reserves_result.rb +25 -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 +44 -0
- data/generated/stellar/claimable_balance_entry/ext.rb +24 -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/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/end_sponsoring_future_reserves_result.rb +25 -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 +10 -0
- data/generated/stellar/operation/body.rb +45 -26
- data/generated/stellar/operation_id.rb +32 -0
- data/generated/stellar/operation_id/id.rb +24 -0
- data/generated/stellar/operation_result.rb +10 -0
- data/generated/stellar/operation_result/tr.rb +48 -28
- data/generated/stellar/operation_result_code.rb +3 -1
- data/generated/stellar/operation_type.rb +25 -15
- data/generated/stellar/path_payment_strict_receive_result.rb +2 -1
- data/generated/stellar/revoke_sponsorship_op.rb +36 -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/transaction_result_code.rb +4 -2
- 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/{version.rb → base/version.rb} +1 -1
- data/lib/stellar/claim_predicate.rb +198 -0
- data/lib/stellar/compat.rb +2 -15
- data/lib/stellar/concerns/transaction.rb +2 -3
- data/lib/stellar/dsl.rb +89 -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 +59 -1
- data/lib/stellar/price.rb +11 -2
- data/lib/stellar/transaction.rb +17 -167
- data/lib/stellar/transaction_builder.rb +35 -18
- data/lib/stellar/transaction_envelope.rb +7 -43
- data/lib/stellar/transaction_v0.rb +5 -1
- data/lib/stellar/util/strkey.rb +6 -6
- metadata +162 -30
- data/generated/stellar/account_entry/ext/v1.rb +0 -34
- 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: b29836900dbce5c01176c3b92c7c3ef365dbca086d700258e00299edf3edbd61
|
4
|
+
data.tar.gz: 0c17163d8d41dc0c7847ea888d5e2650b715dc43ecd552f292dc1090fce6e786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2470776823bd7581c6b0985756001fbfb796368aa8ecb2f6c0ead49c13b776dad0405a37b3f3f9c33c3765b84103a16cd4854a3122e1a4e9ef6712ffa1b12fe
|
7
|
+
data.tar.gz: 1c13e6d755225adc62c22f9e917e74ec178d85df6bfd440ab9ae65d757830c393bab00bb63fb9c8abac34af6c0044a738dea0a1acad03969dda754a627022875
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,124 @@
|
|
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](http://keepachangelog.com/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://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
|
|
10
|
+
## [Unreleased](https://github.com/stellar/ruby-stellar-sdk/compare/v0.26.0...master)
|
11
|
+
|
12
|
+
## [0.26.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.25.0...0.26.0) - 2021-02-05
|
13
|
+
- No changes
|
14
|
+
|
15
|
+
## [0.25.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.24.0...v0.25.0) - 2020-10-30
|
16
|
+
### Added
|
17
|
+
- `MuxedAccount` implements `#to_keypair` conversion protocol
|
18
|
+
- `MuxedAccount` correctly responds to `#address` with strkey encoded public key
|
19
|
+
### Fixed
|
20
|
+
- `Transaction::V0#source_account` now properly returns `MuxedAccount` instead of raw bytes
|
21
|
+
|
22
|
+
## [0.24.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.1...v0.24.0) - 2020-10-20
|
23
|
+
### Added
|
24
|
+
- Add conversion methods for KeyPair and Asset
|
25
|
+
- Stellar Protocol 14 support
|
26
|
+
- Regenerate XDR wrappers from definitions in stellar-core 14.1.1
|
27
|
+
- Add [CAP-23 Two-Part Payments](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0023.md) support
|
28
|
+
- Add ClaimPredicate DSL methods which help with creation of claim predicates.
|
29
|
+
```ruby
|
30
|
+
# use class-level helpers to create simple predicates
|
31
|
+
unconditional = Stellar::ClaimPredicate.unconditional
|
32
|
+
before_rel_time = Stellar::ClaimPredicate.before_relative_time(1.hour)
|
33
|
+
before_abs_time = Stellar::ClaimPredicate.before_absolute_time(Date.tomorrow.beginning_of_day)
|
34
|
+
|
35
|
+
# negate predicates using `~` unary operator
|
36
|
+
~predicate # same as predicate.not
|
37
|
+
|
38
|
+
# build complex predicates using `&` and `|` infix operators
|
39
|
+
predicate & other_predicate # same as `predicate.and(other_predicate)`
|
40
|
+
predicate | other_predicate # same as `predicate.or(other_predicate)`
|
41
|
+
|
42
|
+
# quickly define complex predicates using `.compose` class method with the block
|
43
|
+
unconditional = Stellar::ClaimPredicate.compose { }
|
44
|
+
complex = Stellar::ClaimPredicate.compose do
|
45
|
+
before_relative_time(1.week) & ~before_relative_time(10.seconds) |
|
46
|
+
end
|
47
|
+
|
48
|
+
# here's what building this predicate would look like without DSL
|
49
|
+
complex = Stellar::ClaimPredicate.new(
|
50
|
+
Stellar::ClaimPredicateType::AND,
|
51
|
+
Stellar::ClaimPredicate.new(
|
52
|
+
Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 7 * 24 * 60 * 60
|
53
|
+
),
|
54
|
+
Stellar::ClaimPredicate.new(
|
55
|
+
Stellar::ClaimPredicateType::NOT, Stellar::ClaimPredicate.new(
|
56
|
+
Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 10
|
57
|
+
)
|
58
|
+
)
|
59
|
+
)
|
60
|
+
|
61
|
+
```
|
62
|
+
- Extend Operation with `create_claimable_balance` and `claim_claimable_balance` helpers
|
63
|
+
- Add Claimant and ClaimPredicate DSL methods to reduce the noise.
|
64
|
+
```ruby
|
65
|
+
include Stellar::DSL
|
66
|
+
|
67
|
+
sender = KeyPair('S....')
|
68
|
+
recipient = 'G....'
|
69
|
+
|
70
|
+
op = Operation.create_claimable_balance(
|
71
|
+
asset: Stellar::Asset.native,
|
72
|
+
amount: 100,
|
73
|
+
claimants: [
|
74
|
+
Claimant(recipient) { after(10.seconds) & before(1.week) },
|
75
|
+
Claimant(sender), # allow unconditional claim-back
|
76
|
+
]
|
77
|
+
)
|
78
|
+
])
|
79
|
+
```
|
80
|
+
- Add simple predicate evaluation feature so that developers can sanity-check their predicates
|
81
|
+
```ruby
|
82
|
+
include Stellar::DSL
|
83
|
+
|
84
|
+
predicate = ClaimPredicate { before_relative_time(1.week) & ~before_relative_time(10.seconds) }
|
85
|
+
|
86
|
+
# predicate.evaluate(balance_creation_time, claim_evaluation_time)
|
87
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:00:05") # => false
|
88
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:01:00") # => true
|
89
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 08:50:00") # => true
|
90
|
+
|
91
|
+
# you can also pass an instance of ActiveSupport::Duration as a second parameter, in this case
|
92
|
+
# it works as a relative offset from `balance_creation_time`
|
93
|
+
predicate.evaluate("2020-10-20 09:00:00", 1.week + 1.second) # => false
|
94
|
+
|
95
|
+
# it is effectively the same as
|
96
|
+
predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 09:00:01") # => false
|
97
|
+
```
|
98
|
+
- Add [CAP-33 Sponsored Reserves](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0033.md) support
|
99
|
+
- Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
|
100
|
+
- `Operation.begin_sponsoring_future_reserves`
|
101
|
+
- `Operation.end_sponsoring_future_reserves`
|
102
|
+
- `Operation.revoke_sponsorship(account_id:)`
|
103
|
+
- `Operation.revoke_sponsorship(account_id:, asset:)`
|
104
|
+
- `Operation.revoke_sponsorship(account_id:, offer_id:)`
|
105
|
+
- `Operation.revoke_sponsorship(account_id:, data_name:)`
|
106
|
+
- `Operation.revoke_sponsorship(account_id:, balance_id:)`
|
107
|
+
- `Operation.revoke_sponsorship(account_id:, signer:)`
|
108
|
+
|
109
|
+
|
110
|
+
## [0.23.1](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.0...v0.23.1) - 2020-06-18
|
111
|
+
### Added
|
112
|
+
- Transaction builder now builds V1 transactions
|
113
|
+
- FeeBumpTransaction can wrap V0 transaction
|
114
|
+
|
115
|
+
## [0.23.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.22.0...v0.23.0) - 2020-06-11
|
116
|
+
### Added
|
117
|
+
- Stellar Protocol 13 support
|
118
|
+
- Fee-Bump transactions ([CAP-0015](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md))
|
119
|
+
- Multiplexed accounts ([CAP-0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md))
|
120
|
+
- Fine-Grained control on trustline authorization ([CAP-0018](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0018.md))
|
121
|
+
|
9
122
|
## [0.22.0](https://github.com/stellar/ruby-stellar-base/compare/v0.21.0...v0.22.0) - 2020-03-26
|
10
123
|
### Added
|
11
124
|
- Add TransactionBuilder ([#54](https://github.com/stellar/ruby-stellar-base/issues/54))
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Stellar
|
2
|
-
|
3
|
-
[](https://badge.fury.io/rb/stellar-base)
|
3
|
+
[](https://github.com/astroband/ruby-stellar-sdk/actions?query=branch%3Amaster)
|
4
|
+
[](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.
|
@@ -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<
|
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
|
@@ -10,33 +10,19 @@ require 'xdr'
|
|
10
10
|
# case 0:
|
11
11
|
# void;
|
12
12
|
# case 1:
|
13
|
-
#
|
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,
|
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
|
@@ -0,0 +1,28 @@
|
|
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 switch (int v)
|
9
|
+
# {
|
10
|
+
# case 0:
|
11
|
+
# void;
|
12
|
+
# case 2:
|
13
|
+
# AccountEntryExtensionV2 v2;
|
14
|
+
# }
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class AccountEntryExtensionV1
|
19
|
+
class Ext < XDR::Union
|
20
|
+
switch_on XDR::Int, :v
|
21
|
+
|
22
|
+
switch 0
|
23
|
+
switch 2, :v2
|
24
|
+
|
25
|
+
attribute :v2, AccountEntryExtensionV2
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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 AccountEntryExtensionV2
|
9
|
+
# {
|
10
|
+
# uint32 numSponsored;
|
11
|
+
# uint32 numSponsoring;
|
12
|
+
# SponsorshipDescriptor signerSponsoringIDs<MAX_SIGNERS>;
|
13
|
+
#
|
14
|
+
# union switch (int v)
|
15
|
+
# {
|
16
|
+
# case 0:
|
17
|
+
# void;
|
18
|
+
# }
|
19
|
+
# ext;
|
20
|
+
# };
|
21
|
+
#
|
22
|
+
# ===========================================================================
|
23
|
+
module Stellar
|
24
|
+
class AccountEntryExtensionV2 < XDR::Struct
|
25
|
+
include XDR::Namespace
|
26
|
+
|
27
|
+
autoload :Ext
|
28
|
+
|
29
|
+
attribute :num_sponsored, Uint32
|
30
|
+
attribute :num_sponsoring, Uint32
|
31
|
+
attribute :signer_sponsoring_i_ds, XDR::VarArray[SponsorshipDescriptor, MAX_SIGNERS]
|
32
|
+
attribute :ext, Ext
|
33
|
+
end
|
34
|
+
end
|
@@ -6,23 +6,19 @@ require 'xdr'
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
8
|
# union switch (int v)
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
9
|
+
# {
|
10
|
+
# case 0:
|
11
|
+
# void;
|
12
|
+
# }
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
|
-
class
|
17
|
-
class Ext
|
18
|
-
|
19
|
-
class Ext < XDR::Union
|
20
|
-
switch_on XDR::Int, :v
|
16
|
+
class AccountEntryExtensionV2
|
17
|
+
class Ext < XDR::Union
|
18
|
+
switch_on XDR::Int, :v
|
21
19
|
|
22
|
-
|
20
|
+
switch 0
|
23
21
|
|
24
|
-
end
|
25
|
-
end
|
26
22
|
end
|
27
23
|
end
|
28
24
|
end
|
@@ -15,8 +15,9 @@ require 'xdr'
|
|
15
15
|
# ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set
|
16
16
|
# ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers
|
17
17
|
# ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed
|
18
|
-
# ACCOUNT_MERGE_DEST_FULL = -6
|
18
|
+
# ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to
|
19
19
|
# // destination balance
|
20
|
+
# ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor
|
20
21
|
# };
|
21
22
|
#
|
22
23
|
# ===========================================================================
|
@@ -29,6 +30,7 @@ module Stellar
|
|
29
30
|
member :account_merge_has_sub_entries, -4
|
30
31
|
member :account_merge_seqnum_too_far, -5
|
31
32
|
member :account_merge_dest_full, -6
|
33
|
+
member :account_merge_is_sponsor, -7
|
32
34
|
|
33
35
|
seal
|
34
36
|
end
|