stellar-base 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/generated/stellar/allow_trust_result_code.rb +4 -1
  4. data/generated/stellar/alpha_num12.rb +20 -0
  5. data/generated/stellar/alpha_num4.rb +20 -0
  6. data/generated/stellar/asset.rb +2 -15
  7. data/generated/stellar/asset_type.rb +3 -1
  8. data/generated/stellar/change_trust_asset.rb +39 -0
  9. data/generated/stellar/change_trust_op.rb +2 -2
  10. data/generated/stellar/change_trust_result_code.rb +13 -7
  11. data/generated/stellar/claim_atom.rb +31 -0
  12. data/generated/stellar/claim_atom_type.rb +24 -0
  13. data/generated/stellar/claim_liquidity_atom.rb +30 -0
  14. data/generated/stellar/claim_offer_atom_v0.rb +33 -0
  15. data/generated/stellar/envelope_type.rb +10 -8
  16. data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +2 -2
  17. data/generated/stellar/{operation_id.rb → hash_id_preimage/revoke_id.rb} +12 -16
  18. data/generated/stellar/hash_id_preimage.rb +44 -0
  19. data/generated/stellar/ledger_entry/data.rb +4 -0
  20. data/generated/stellar/ledger_entry.rb +2 -0
  21. data/generated/stellar/ledger_entry_type.rb +3 -1
  22. data/generated/stellar/ledger_header/ext.rb +4 -0
  23. data/generated/stellar/ledger_header.rb +2 -0
  24. data/generated/stellar/{asset/alpha_num12.rb → ledger_header_extension_v1/ext.rb} +9 -7
  25. data/generated/stellar/ledger_header_extension_v1.rb +30 -0
  26. data/generated/stellar/ledger_header_flags.rb +24 -0
  27. data/generated/stellar/{asset/alpha_num4.rb → ledger_key/liquidity_pool.rb} +4 -6
  28. data/generated/stellar/ledger_key/trust_line.rb +2 -2
  29. data/generated/stellar/ledger_key.rb +10 -1
  30. data/generated/stellar/ledger_upgrade.rb +4 -0
  31. data/generated/stellar/ledger_upgrade_type.rb +3 -1
  32. data/generated/stellar/liquidity_pool_constant_product_parameters.rb +22 -0
  33. data/generated/stellar/liquidity_pool_deposit_op.rb +26 -0
  34. data/generated/stellar/liquidity_pool_deposit_result.rb +26 -0
  35. data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
  36. data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +31 -0
  37. data/generated/stellar/liquidity_pool_entry/body.rb +37 -0
  38. data/generated/stellar/liquidity_pool_entry.rb +38 -0
  39. data/generated/stellar/liquidity_pool_parameters.rb +23 -0
  40. data/generated/stellar/liquidity_pool_type.rb +20 -0
  41. data/generated/stellar/liquidity_pool_withdraw_op.rb +24 -0
  42. data/generated/stellar/liquidity_pool_withdraw_result.rb +26 -0
  43. data/generated/stellar/liquidity_pool_withdraw_result_code.rb +36 -0
  44. data/generated/stellar/manage_offer_success_result.rb +2 -2
  45. data/generated/stellar/operation/body.rb +8 -0
  46. data/generated/stellar/operation.rb +4 -0
  47. data/generated/stellar/operation_result/tr.rb +8 -0
  48. data/generated/stellar/operation_result.rb +4 -0
  49. data/generated/stellar/operation_type.rb +5 -1
  50. data/generated/stellar/path_payment_strict_receive_result/success.rb +2 -2
  51. data/generated/stellar/path_payment_strict_receive_result.rb +1 -1
  52. data/generated/stellar/path_payment_strict_send_result/success.rb +2 -2
  53. data/generated/stellar/path_payment_strict_send_result.rb +1 -1
  54. data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
  55. data/generated/stellar/scp_quorum_set.rb +2 -2
  56. data/generated/stellar/set_trust_line_flags_result_code.rb +4 -1
  57. data/generated/stellar/trust_line_asset.rb +39 -0
  58. data/generated/stellar/trust_line_entry/ext/v1/ext.rb +4 -0
  59. data/generated/stellar/trust_line_entry/ext/v1.rb +2 -0
  60. data/generated/stellar/trust_line_entry/ext.rb +2 -0
  61. data/generated/stellar/trust_line_entry.rb +7 -5
  62. data/generated/stellar/trust_line_entry_extension_v2/ext.rb +24 -0
  63. data/generated/stellar/trust_line_entry_extension_v2.rb +30 -0
  64. data/generated/stellar-base-generated.rb +25 -1
  65. data/lib/stellar/account_flags.rb +1 -1
  66. data/lib/stellar/amount.rb +36 -0
  67. data/lib/stellar/asset.rb +8 -0
  68. data/lib/stellar/dsl.rb +3 -0
  69. data/lib/stellar/ledger_key.rb +5 -3
  70. data/lib/stellar/liquidity_pool/base_pool.rb +47 -0
  71. data/lib/stellar/liquidity_pool/constant_product_pool.rb +15 -0
  72. data/lib/stellar/liquidity_pool.rb +12 -0
  73. data/lib/stellar/operation.rb +346 -444
  74. data/lib/stellar/price.rb +13 -7
  75. data/lib/stellar/transaction_builder.rb +8 -5
  76. data/lib/stellar/version.rb +1 -1
  77. data/lib/stellar-base.rb +2 -0
  78. metadata +39 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e34d24d567ded9c3e2a6f8b5c043d905b1606d954b9c1e0f9d06cb1bccf07d22
4
- data.tar.gz: 2fc5f03bc44df1adb28c136f72261be94a7cd1bf668358150f2d477dcd4187da
3
+ metadata.gz: e9ac52e5c6ee35610edeab9f27a3e48cd57c641d1270322b2419dd5024ebcbd0
4
+ data.tar.gz: 32aef3aced95b9537e6650927621e5a33c6cf6eedb40ab5766dbaf92224e6d02
5
5
  SHA512:
6
- metadata.gz: a50f950abc85606cea2077cabc92e32f4734a5bd336945a8718b30c5766c0ebee562351fbaaa85cb0602851504b7edf41e0f9560f96570a86b9b5a7fd5500c30
7
- data.tar.gz: 87b85c15be138718404efdc6e738d3577117f4cdf9e9b0d26dbd2ff6c9e5ff58c05e5f47ba966d462494304f632c485ab52870e078988a3c40801aa44a8c8875
6
+ metadata.gz: f220d030282b21fc515eb6773959a6edfdf8e60f4232e490006b1e68024f2af86c5672c1b210e03728244e6e06729d9c7fb77adaefb44bc6e2deee6fdaed9475
7
+ data.tar.gz: cd7ce1b154f42558b021a8173017487321f8d20a59e84c37538bc826a2f4d6cb272162f3875ebf6d383308ffea486406c456e6759a36f82da0a94a8488c31b2c
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
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
+ ## [0.30.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.29.0...v0.30.0) (2021-10-14)
11
+
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
+
10
19
  ## [0.29.0](https://www.github.com/astroband/ruby-stellar-sdk/compare/v0.28.0...v0.29.0) (2021-09-07)
11
20
  - No changes
12
21
 
@@ -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
@@ -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
@@ -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
@@ -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
+ # struct ClaimLiquidityAtom
9
+ # {
10
+ # PoolID liquidityPoolID;
11
+ #
12
+ # // amount and asset taken from the pool
13
+ # Asset assetSold;
14
+ # int64 amountSold;
15
+ #
16
+ # // amount and asset sent to the pool
17
+ # Asset assetBought;
18
+ # int64 amountBought;
19
+ # };
20
+ #
21
+ # ===========================================================================
22
+ module Stellar
23
+ class ClaimLiquidityAtom < XDR::Struct
24
+ attribute :liquidity_pool_id, PoolID
25
+ attribute :asset_sold, Asset
26
+ attribute :amount_sold, Int64
27
+ attribute :asset_bought, Asset
28
+ attribute :amount_bought, Int64
29
+ end
30
+ end
@@ -0,0 +1,33 @@
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 ClaimOfferAtomV0
9
+ # {
10
+ # // emitted to identify the offer
11
+ # uint256 sellerEd25519; // Account that owns the offer
12
+ # int64 offerID;
13
+ #
14
+ # // amount and asset taken from the owner
15
+ # Asset assetSold;
16
+ # int64 amountSold;
17
+ #
18
+ # // amount and asset sent to the owner
19
+ # Asset assetBought;
20
+ # int64 amountBought;
21
+ # };
22
+ #
23
+ # ===========================================================================
24
+ module Stellar
25
+ class ClaimOfferAtomV0 < XDR::Struct
26
+ attribute :seller_ed25519, Uint256
27
+ attribute :offer_id, Int64
28
+ attribute :asset_sold, Asset
29
+ attribute :amount_sold, Int64
30
+ attribute :asset_bought, Asset
31
+ attribute :amount_bought, Int64
32
+ end
33
+ end
@@ -13,19 +13,21 @@ require 'xdr'
13
13
  # ENVELOPE_TYPE_AUTH = 3,
14
14
  # ENVELOPE_TYPE_SCPVALUE = 4,
15
15
  # ENVELOPE_TYPE_TX_FEE_BUMP = 5,
16
- # ENVELOPE_TYPE_OP_ID = 6
16
+ # ENVELOPE_TYPE_OP_ID = 6,
17
+ # ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7
17
18
  # };
18
19
  #
19
20
  # ===========================================================================
20
21
  module Stellar
21
22
  class EnvelopeType < XDR::Enum
22
- member :envelope_type_tx_v0, 0
23
- member :envelope_type_scp, 1
24
- member :envelope_type_tx, 2
25
- member :envelope_type_auth, 3
26
- member :envelope_type_scpvalue, 4
27
- member :envelope_type_tx_fee_bump, 5
28
- member :envelope_type_op_id, 6
23
+ member :envelope_type_tx_v0, 0
24
+ member :envelope_type_scp, 1
25
+ member :envelope_type_tx, 2
26
+ member :envelope_type_auth, 3
27
+ member :envelope_type_scpvalue, 4
28
+ member :envelope_type_tx_fee_bump, 5
29
+ member :envelope_type_op_id, 6
30
+ member :envelope_type_pool_revoke_op_id, 7
29
31
 
30
32
  seal
31
33
  end
@@ -14,8 +14,8 @@ require 'xdr'
14
14
  #
15
15
  # ===========================================================================
16
16
  module Stellar
17
- class OperationID
18
- class Id < XDR::Struct
17
+ class HashIDPreimage
18
+ class OperationID < XDR::Struct
19
19
  attribute :source_account, AccountID
20
20
  attribute :seq_num, SequenceNumber
21
21
  attribute :op_num, Uint32
@@ -5,28 +5,24 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # union OperationID switch (EnvelopeType type)
9
- # {
10
- # case ENVELOPE_TYPE_OP_ID:
11
- # struct
8
+ # struct
12
9
  # {
13
10
  # AccountID sourceAccount;
14
11
  # SequenceNumber seqNum;
15
12
  # uint32 opNum;
16
- # } id;
17
- # };
13
+ # PoolID liquidityPoolID;
14
+ # Asset asset;
15
+ # }
18
16
  #
19
17
  # ===========================================================================
20
18
  module Stellar
21
- class OperationID < XDR::Union
22
- include XDR::Namespace
23
-
24
- autoload :Id
25
-
26
- switch_on EnvelopeType, :type
27
-
28
- switch :envelope_type_op_id, :id
29
-
30
- attribute :id, Id
19
+ class HashIDPreimage
20
+ class RevokeID < XDR::Struct
21
+ attribute :source_account, AccountID
22
+ attribute :seq_num, SequenceNumber
23
+ attribute :op_num, Uint32
24
+ attribute :liquidity_pool_id, PoolID
25
+ attribute :asset, Asset
26
+ end
31
27
  end
32
28
  end
@@ -0,0 +1,44 @@
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 HashIDPreimage switch (EnvelopeType type)
9
+ # {
10
+ # case ENVELOPE_TYPE_OP_ID:
11
+ # struct
12
+ # {
13
+ # AccountID sourceAccount;
14
+ # SequenceNumber seqNum;
15
+ # uint32 opNum;
16
+ # } operationID;
17
+ # case ENVELOPE_TYPE_POOL_REVOKE_OP_ID:
18
+ # struct
19
+ # {
20
+ # AccountID sourceAccount;
21
+ # SequenceNumber seqNum;
22
+ # uint32 opNum;
23
+ # PoolID liquidityPoolID;
24
+ # Asset asset;
25
+ # } revokeID;
26
+ # };
27
+ #
28
+ # ===========================================================================
29
+ module Stellar
30
+ class HashIDPreimage < XDR::Union
31
+ include XDR::Namespace
32
+
33
+ autoload :OperationID
34
+ autoload :RevokeID
35
+
36
+ switch_on EnvelopeType, :type
37
+
38
+ switch :envelope_type_op_id, :operation_id
39
+ switch :envelope_type_pool_revoke_op_id, :revoke_id
40
+
41
+ attribute :operation_id, OperationID
42
+ attribute :revoke_id, RevokeID
43
+ end
44
+ end
@@ -17,6 +17,8 @@ require 'xdr'
17
17
  # DataEntry data;
18
18
  # case CLAIMABLE_BALANCE:
19
19
  # ClaimableBalanceEntry claimableBalance;
20
+ # case LIQUIDITY_POOL:
21
+ # LiquidityPoolEntry liquidityPool;
20
22
  # }
21
23
  #
22
24
  # ===========================================================================
@@ -30,12 +32,14 @@ module Stellar
30
32
  switch :offer, :offer
31
33
  switch :data, :data
32
34
  switch :claimable_balance, :claimable_balance
35
+ switch :liquidity_pool, :liquidity_pool
33
36
 
34
37
  attribute :account, AccountEntry
35
38
  attribute :trust_line, TrustLineEntry
36
39
  attribute :offer, OfferEntry
37
40
  attribute :data, DataEntry
38
41
  attribute :claimable_balance, ClaimableBalanceEntry
42
+ attribute :liquidity_pool, LiquidityPoolEntry
39
43
  end
40
44
  end
41
45
  end
@@ -21,6 +21,8 @@ require 'xdr'
21
21
  # DataEntry data;
22
22
  # case CLAIMABLE_BALANCE:
23
23
  # ClaimableBalanceEntry claimableBalance;
24
+ # case LIQUIDITY_POOL:
25
+ # LiquidityPoolEntry liquidityPool;
24
26
  # }
25
27
  # data;
26
28
  #
@@ -11,7 +11,8 @@ require 'xdr'
11
11
  # TRUSTLINE = 1,
12
12
  # OFFER = 2,
13
13
  # DATA = 3,
14
- # CLAIMABLE_BALANCE = 4
14
+ # CLAIMABLE_BALANCE = 4,
15
+ # LIQUIDITY_POOL = 5
15
16
  # };
16
17
  #
17
18
  # ===========================================================================
@@ -22,6 +23,7 @@ module Stellar
22
23
  member :offer, 2
23
24
  member :data, 3
24
25
  member :claimable_balance, 4
26
+ member :liquidity_pool, 5
25
27
 
26
28
  seal
27
29
  end
@@ -9,6 +9,8 @@ require 'xdr'
9
9
  # {
10
10
  # case 0:
11
11
  # void;
12
+ # case 1:
13
+ # LedgerHeaderExtensionV1 v1;
12
14
  # }
13
15
  #
14
16
  # ===========================================================================
@@ -18,7 +20,9 @@ module Stellar
18
20
  switch_on XDR::Int, :v
19
21
 
20
22
  switch 0
23
+ switch 1, :v1
21
24
 
25
+ attribute :v1, LedgerHeaderExtensionV1
22
26
  end
23
27
  end
24
28
  end
@@ -39,6 +39,8 @@ require 'xdr'
39
39
  # {
40
40
  # case 0:
41
41
  # void;
42
+ # case 1:
43
+ # LedgerHeaderExtensionV1 v1;
42
44
  # }
43
45
  # ext;
44
46
  # };
@@ -5,18 +5,20 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # struct
8
+ # union switch (int v)
9
9
  # {
10
- # AssetCode12 assetCode;
11
- # AccountID issuer;
10
+ # case 0:
11
+ # void;
12
12
  # }
13
13
  #
14
14
  # ===========================================================================
15
15
  module Stellar
16
- class Asset
17
- class AlphaNum12 < XDR::Struct
18
- attribute :asset_code, AssetCode12
19
- attribute :issuer, AccountID
16
+ class LedgerHeaderExtensionV1
17
+ class Ext < XDR::Union
18
+ switch_on XDR::Int, :v
19
+
20
+ switch 0
21
+
20
22
  end
21
23
  end
22
24
  end
@@ -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
+ # struct LedgerHeaderExtensionV1
9
+ # {
10
+ # uint32 flags; // LedgerHeaderFlags
11
+ #
12
+ # union switch (int v)
13
+ # {
14
+ # case 0:
15
+ # void;
16
+ # }
17
+ # ext;
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class LedgerHeaderExtensionV1 < XDR::Struct
23
+ include XDR::Namespace
24
+
25
+ autoload :Ext
26
+
27
+ attribute :flags, Uint32
28
+ attribute :ext, Ext
29
+ end
30
+ 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 LedgerHeaderFlags
9
+ # {
10
+ # DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1,
11
+ # DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2,
12
+ # DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class LedgerHeaderFlags < XDR::Enum
18
+ member :disable_liquidity_pool_trading_flag, 1
19
+ member :disable_liquidity_pool_deposit_flag, 2
20
+ member :disable_liquidity_pool_withdrawal_flag, 4
21
+
22
+ seal
23
+ end
24
+ end