stellar-base 0.23.0.rc2 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +111 -1
  3. data/README.md +4 -7
  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 +18 -5
  59. data/lib/stellar/account_flags.rb +1 -1
  60. data/lib/stellar/asset.rb +10 -0
  61. data/lib/stellar/{version.rb → base/version.rb} +1 -1
  62. data/lib/stellar/claim_predicate.rb +198 -0
  63. data/lib/stellar/compat.rb +2 -15
  64. data/lib/stellar/concerns/transaction.rb +2 -3
  65. data/lib/stellar/dsl.rb +89 -0
  66. data/lib/stellar/ext/xdr.rb +50 -0
  67. data/lib/stellar/key_pair.rb +60 -53
  68. data/lib/stellar/ledger_key.rb +32 -0
  69. data/lib/stellar/muxed_account.rb +16 -0
  70. data/lib/stellar/networks.rb +12 -12
  71. data/lib/stellar/operation.rb +59 -1
  72. data/lib/stellar/price.rb +11 -2
  73. data/lib/stellar/transaction.rb +17 -167
  74. data/lib/stellar/transaction_builder.rb +35 -18
  75. data/lib/stellar/transaction_envelope.rb +7 -43
  76. data/lib/stellar/transaction_v0.rb +5 -1
  77. data/lib/stellar/util/strkey.rb +6 -6
  78. metadata +164 -32
  79. data/generated/stellar/account_entry/ext/v1.rb +0 -34
  80. data/lib/stellar/util/continued_fraction.rb +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f64a35c5eb47bfa8040c4486337eda24bab4016e9009aae6efc0bf7e177c919
4
- data.tar.gz: 835b73de784daaeca652261baff0f2aff22606e465308954938f2ca41773cc95
3
+ metadata.gz: 06de7ab1f501228afa8b011a494da83f9a75c9723f2612868bb7e324ee309794
4
+ data.tar.gz: 9a0f29f6b55bf4e508dc54a3fb131b411799022c2bf87fd5246119e681efaf99
5
5
  SHA512:
6
- metadata.gz: ae8f2a920a9084610976de5efa719e37a32d9d8a1221ecb071a7d9ab85f8af026e9a6ac8bbb2b149a8265877bee28ed83fc175ead0f1203d93728ddb302d0dd2
7
- data.tar.gz: d916c3ef5da72b34f32fa274bfe94206a0b6ee6b8dc2dd2a7a1585534be58b753b3ea3f4a832bc671577700b0fb2d1fcc66ac9f5d955d34f00444492503db199
6
+ metadata.gz: fb09428b1c5c96b291a114132c989b9cd5aa602a2e67989748c014de1bc6179fad881449e5dcaeb956b3ae5dc2c259f740d9223d822e35da29831c6a62465c73
7
+ data.tar.gz: 5a31dee71d5d6dd1140eebc06f8ae353d6a63e7678e4be220e8f572b6d77268b77948303d62ec4d2b06dc2e3896e0eda0a41995436a82525fb481ace9ca16241
@@ -1,11 +1,121 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this
4
- file. This project adheres to [Semantic Versioning](http://semver.org/).
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.25.0...master)
11
+
12
+ ## [0.25.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.24.0...v0.25.0) - 2020-10-30
13
+ ### Added
14
+ - `MuxedAccount` implements `#to_keypair` conversion protocol
15
+ - `MuxedAccount` correctly responds to `#address` with strkey encoded public key
16
+ ### Fixed
17
+ - `Transaction::V0#source_account` now properly returns `MuxedAccount` instead of raw bytes
18
+
19
+ ## [0.24.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.1...v0.24.0) - 2020-10-20
20
+ ### Added
21
+ - Add conversion methods for KeyPair and Asset
22
+ - Stellar Protocol 14 support
23
+ - Regenerate XDR wrappers from definitions in stellar-core 14.1.1
24
+ - Add [CAP-23 Two-Part Payments](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0023.md) support
25
+ - Add ClaimPredicate DSL methods which help with creation of claim predicates.
26
+ ```ruby
27
+ # use class-level helpers to create simple predicates
28
+ unconditional = Stellar::ClaimPredicate.unconditional
29
+ before_rel_time = Stellar::ClaimPredicate.before_relative_time(1.hour)
30
+ before_abs_time = Stellar::ClaimPredicate.before_absolute_time(Date.tomorrow.beginning_of_day)
31
+
32
+ # negate predicates using `~` unary operator
33
+ ~predicate # same as predicate.not
34
+
35
+ # build complex predicates using `&` and `|` infix operators
36
+ predicate & other_predicate # same as `predicate.and(other_predicate)`
37
+ predicate | other_predicate # same as `predicate.or(other_predicate)`
38
+
39
+ # quickly define complex predicates using `.compose` class method with the block
40
+ unconditional = Stellar::ClaimPredicate.compose { }
41
+ complex = Stellar::ClaimPredicate.compose do
42
+ before_relative_time(1.week) & ~before_relative_time(10.seconds) |
43
+ end
44
+
45
+ # here's what building this predicate would look like without DSL
46
+ complex = Stellar::ClaimPredicate.new(
47
+ Stellar::ClaimPredicateType::AND,
48
+ Stellar::ClaimPredicate.new(
49
+ Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 7 * 24 * 60 * 60
50
+ ),
51
+ Stellar::ClaimPredicate.new(
52
+ Stellar::ClaimPredicateType::NOT, Stellar::ClaimPredicate.new(
53
+ Stellar::ClaimPredicateType::BEFORE_RELATIVE_TIME, 10
54
+ )
55
+ )
56
+ )
57
+
58
+ ```
59
+ - Extend Operation with `create_claimable_balance` and `claim_claimable_balance` helpers
60
+ - Add Claimant and ClaimPredicate DSL methods to reduce the noise.
61
+ ```ruby
62
+ include Stellar::DSL
63
+
64
+ sender = KeyPair('S....')
65
+ recipient = 'G....'
66
+
67
+ op = Operation.create_claimable_balance(
68
+ asset: Stellar::Asset.native,
69
+ amount: 100,
70
+ claimants: [
71
+ Claimant(recipient) { after(10.seconds) & before(1.week) },
72
+ Claimant(sender), # allow unconditional claim-back
73
+ ]
74
+ )
75
+ ])
76
+ ```
77
+ - Add simple predicate evaluation feature so that developers can sanity-check their predicates
78
+ ```ruby
79
+ include Stellar::DSL
80
+
81
+ predicate = ClaimPredicate { before_relative_time(1.week) & ~before_relative_time(10.seconds) }
82
+
83
+ # predicate.evaluate(balance_creation_time, claim_evaluation_time)
84
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:00:05") # => false
85
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-20 09:01:00") # => true
86
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 08:50:00") # => true
87
+
88
+ # you can also pass an instance of ActiveSupport::Duration as a second parameter, in this case
89
+ # it works as a relative offset from `balance_creation_time`
90
+ predicate.evaluate("2020-10-20 09:00:00", 1.week + 1.second) # => false
91
+
92
+ # it is effectively the same as
93
+ predicate.evaluate("2020-10-20 09:00:00", "2020-10-27 09:00:01") # => false
94
+ ```
95
+ - Add [CAP-33 Sponsored Reserves](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0033.md) support
96
+ - Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
97
+ - `Operation.begin_sponsoring_future_reserves`
98
+ - `Operation.end_sponsoring_future_reserves`
99
+ - `Operation.revoke_sponsorship(account_id:)`
100
+ - `Operation.revoke_sponsorship(account_id:, asset:)`
101
+ - `Operation.revoke_sponsorship(account_id:, offer_id:)`
102
+ - `Operation.revoke_sponsorship(account_id:, data_name:)`
103
+ - `Operation.revoke_sponsorship(account_id:, balance_id:)`
104
+ - `Operation.revoke_sponsorship(account_id:, signer:)`
105
+
106
+
107
+ ## [0.23.1](https://github.com/stellar/ruby-stellar-sdk/compare/v0.23.0...v0.23.1) - 2020-06-18
108
+ ### Added
109
+ - Transaction builder now builds V1 transactions
110
+ - FeeBumpTransaction can wrap V0 transaction
111
+
112
+ ## [0.23.0](https://github.com/stellar/ruby-stellar-sdk/compare/v0.22.0...v0.23.0) - 2020-06-11
113
+ ### Added
114
+ - Stellar Protocol 13 support
115
+ - Fee-Bump transactions ([CAP-0015](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md))
116
+ - Multiplexed accounts ([CAP-0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md))
117
+ - Fine-Grained control on trustline authorization ([CAP-0018](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0018.md))
118
+
9
119
  ## [0.22.0](https://github.com/stellar/ruby-stellar-base/compare/v0.21.0...v0.22.0) - 2020-03-26
10
120
  ### Added
11
121
  - Add TransactionBuilder ([#54](https://github.com/stellar/ruby-stellar-base/issues/54))
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Stellar::Base
2
-
3
- [![Build Status](https://travis-ci.org/stellar/ruby-stellar-base.svg)](https://travis-ci.org/stellar/ruby-stellar-base)
4
- [![Code Climate](https://codeclimate.com/github/stellar/ruby-stellar-base/badges/gpa.svg)](https://codeclimate.com/github/stellar/ruby-stellar-base)
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.
@@ -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
@@ -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
- # case 0:
11
- # void;
12
- # }
9
+ # {
10
+ # case 0:
11
+ # void;
12
+ # }
13
13
  #
14
14
  # ===========================================================================
15
15
  module Stellar
16
- class AccountEntry
17
- class Ext
18
- class V1
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
- switch 0
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 // can't add source balance to
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