stellar-base 0.29.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/generated/stellar/account_entry_extension_v2/ext.rb +4 -0
  4. data/generated/stellar/account_entry_extension_v2.rb +2 -0
  5. data/generated/stellar/account_entry_extension_v3.rb +28 -0
  6. data/generated/stellar/allow_trust_result_code.rb +5 -2
  7. data/generated/stellar/alpha_num12.rb +20 -0
  8. data/generated/stellar/alpha_num4.rb +20 -0
  9. data/generated/stellar/asset.rb +2 -15
  10. data/generated/stellar/asset_type.rb +3 -1
  11. data/generated/stellar/change_trust_asset.rb +39 -0
  12. data/generated/stellar/change_trust_op.rb +2 -2
  13. data/generated/stellar/change_trust_result_code.rb +15 -7
  14. data/generated/stellar/claim_atom.rb +31 -0
  15. data/generated/stellar/claim_atom_type.rb +24 -0
  16. data/generated/stellar/claim_liquidity_atom.rb +30 -0
  17. data/generated/stellar/claim_offer_atom_v0.rb +33 -0
  18. data/generated/stellar/crypto_key_type.rb +6 -4
  19. data/generated/stellar/envelope_type.rb +10 -8
  20. data/generated/stellar/extension_point.rb +22 -0
  21. data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +2 -2
  22. data/generated/stellar/{operation_id.rb → hash_id_preimage/revoke_id.rb} +12 -16
  23. data/generated/stellar/hash_id_preimage.rb +44 -0
  24. data/generated/stellar/inner_transaction_result/result.rb +6 -2
  25. data/generated/stellar/inner_transaction_result.rb +2 -0
  26. data/generated/stellar/ledger_bounds.rb +20 -0
  27. data/generated/stellar/ledger_entry/data.rb +4 -0
  28. data/generated/stellar/ledger_entry.rb +2 -0
  29. data/generated/stellar/ledger_entry_type.rb +3 -1
  30. data/generated/stellar/ledger_header/ext.rb +4 -0
  31. data/generated/stellar/ledger_header.rb +2 -0
  32. data/generated/stellar/{asset/alpha_num12.rb → ledger_header_extension_v1/ext.rb} +9 -7
  33. data/generated/stellar/ledger_header_extension_v1.rb +30 -0
  34. data/generated/stellar/ledger_header_flags.rb +24 -0
  35. data/generated/stellar/{asset/alpha_num4.rb → ledger_key/liquidity_pool.rb} +4 -6
  36. data/generated/stellar/ledger_key/trust_line.rb +2 -2
  37. data/generated/stellar/ledger_key.rb +10 -1
  38. data/generated/stellar/ledger_upgrade.rb +4 -0
  39. data/generated/stellar/ledger_upgrade_type.rb +3 -1
  40. data/generated/stellar/liquidity_pool_constant_product_parameters.rb +22 -0
  41. data/generated/stellar/liquidity_pool_deposit_op.rb +26 -0
  42. data/generated/stellar/liquidity_pool_deposit_result.rb +25 -0
  43. data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
  44. data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +32 -0
  45. data/generated/stellar/liquidity_pool_entry/body.rb +38 -0
  46. data/generated/stellar/liquidity_pool_entry.rb +39 -0
  47. data/generated/stellar/liquidity_pool_parameters.rb +23 -0
  48. data/generated/stellar/liquidity_pool_type.rb +20 -0
  49. data/generated/stellar/liquidity_pool_withdraw_op.rb +24 -0
  50. data/generated/stellar/liquidity_pool_withdraw_result.rb +25 -0
  51. data/generated/stellar/liquidity_pool_withdraw_result_code.rb +36 -0
  52. data/generated/stellar/manage_offer_success_result.rb +2 -2
  53. data/generated/stellar/message_type.rb +4 -1
  54. data/generated/stellar/offer_entry_flags.rb +2 -1
  55. data/generated/stellar/operation/body.rb +8 -0
  56. data/generated/stellar/operation.rb +4 -0
  57. data/generated/stellar/operation_result/tr.rb +8 -0
  58. data/generated/stellar/operation_result.rb +4 -0
  59. data/generated/stellar/operation_type.rb +5 -1
  60. data/generated/stellar/path_payment_strict_receive_result/success.rb +2 -2
  61. data/generated/stellar/path_payment_strict_receive_result.rb +1 -1
  62. data/generated/stellar/path_payment_strict_send_result/success.rb +2 -2
  63. data/generated/stellar/path_payment_strict_send_result.rb +1 -1
  64. data/generated/stellar/precondition_type.rb +24 -0
  65. data/generated/stellar/preconditions.rb +30 -0
  66. data/generated/stellar/preconditions_v2.rb +51 -0
  67. data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
  68. data/generated/stellar/scp_quorum_set.rb +2 -2
  69. data/generated/stellar/send_more.rb +18 -0
  70. data/generated/stellar/set_trust_line_flags_result_code.rb +4 -1
  71. data/generated/stellar/signer_key/ed25519_signed_payload.rb +24 -0
  72. data/generated/stellar/signer_key.rb +20 -6
  73. data/generated/stellar/signer_key_type.rb +6 -4
  74. data/generated/stellar/stellar_message.rb +4 -0
  75. data/generated/stellar/transaction.rb +3 -3
  76. data/generated/stellar/transaction_result_code.rb +6 -1
  77. data/generated/stellar/trust_line_asset.rb +39 -0
  78. data/generated/stellar/trust_line_entry/ext/v1/ext.rb +4 -0
  79. data/generated/stellar/trust_line_entry/ext/v1.rb +2 -0
  80. data/generated/stellar/trust_line_entry/ext.rb +2 -0
  81. data/generated/stellar/trust_line_entry.rb +7 -5
  82. data/generated/stellar/trust_line_entry_extension_v2/ext.rb +24 -0
  83. data/generated/stellar/trust_line_entry_extension_v2.rb +30 -0
  84. data/generated/stellar-base-generated.rb +33 -1
  85. data/lib/stellar/account_flags.rb +1 -1
  86. data/lib/stellar/amount.rb +36 -0
  87. data/lib/stellar/asset.rb +8 -0
  88. data/lib/stellar/dsl.rb +3 -0
  89. data/lib/stellar/ledger_key.rb +5 -3
  90. data/lib/stellar/liquidity_pool/base_pool.rb +47 -0
  91. data/lib/stellar/liquidity_pool/constant_product_pool.rb +15 -0
  92. data/lib/stellar/liquidity_pool.rb +12 -0
  93. data/lib/stellar/operation.rb +346 -444
  94. data/lib/stellar/price.rb +13 -7
  95. data/lib/stellar/transaction.rb +1 -1
  96. data/lib/stellar/transaction_builder.rb +120 -18
  97. data/lib/stellar/transaction_v0.rb +5 -1
  98. data/lib/stellar/util/strkey.rb +15 -1
  99. data/lib/stellar/version.rb +1 -1
  100. data/lib/stellar-base.rb +2 -0
  101. metadata +51 -70
@@ -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 LedgerBounds
9
+ # {
10
+ # uint32 minLedger;
11
+ # uint32 maxLedger; // 0 here means no maxLedger
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class LedgerBounds < XDR::Struct
17
+ attribute :min_ledger, Uint32
18
+ attribute :max_ledger, Uint32
19
+ end
20
+ 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
@@ -7,16 +7,14 @@ require 'xdr'
7
7
  #
8
8
  # struct
9
9
  # {
10
- # AssetCode4 assetCode;
11
- # AccountID issuer;
10
+ # PoolID liquidityPoolID;
12
11
  # }
13
12
  #
14
13
  # ===========================================================================
15
14
  module Stellar
16
- class Asset
17
- class AlphaNum4 < XDR::Struct
18
- attribute :asset_code, AssetCode4
19
- attribute :issuer, AccountID
15
+ class LedgerKey
16
+ class LiquidityPool < XDR::Struct
17
+ attribute :liquidity_pool_id, PoolID
20
18
  end
21
19
  end
22
20
  end
@@ -8,7 +8,7 @@ require 'xdr'
8
8
  # struct
9
9
  # {
10
10
  # AccountID accountID;
11
- # Asset asset;
11
+ # TrustLineAsset asset;
12
12
  # }
13
13
  #
14
14
  # ===========================================================================
@@ -16,7 +16,7 @@ module Stellar
16
16
  class LedgerKey
17
17
  class TrustLine < XDR::Struct
18
18
  attribute :account_id, AccountID
19
- attribute :asset, Asset
19
+ attribute :asset, TrustLineAsset
20
20
  end
21
21
  end
22
22
  end
@@ -17,7 +17,7 @@ require 'xdr'
17
17
  # struct
18
18
  # {
19
19
  # AccountID accountID;
20
- # Asset asset;
20
+ # TrustLineAsset asset;
21
21
  # } trustLine;
22
22
  #
23
23
  # case OFFER:
@@ -39,6 +39,12 @@ require 'xdr'
39
39
  # {
40
40
  # ClaimableBalanceID balanceID;
41
41
  # } claimableBalance;
42
+ #
43
+ # case LIQUIDITY_POOL:
44
+ # struct
45
+ # {
46
+ # PoolID liquidityPoolID;
47
+ # } liquidityPool;
42
48
  # };
43
49
  #
44
50
  # ===========================================================================
@@ -51,6 +57,7 @@ module Stellar
51
57
  autoload :Offer
52
58
  autoload :Data
53
59
  autoload :ClaimableBalance
60
+ autoload :LiquidityPool
54
61
 
55
62
  switch_on LedgerEntryType, :type
56
63
 
@@ -59,11 +66,13 @@ module Stellar
59
66
  switch :offer, :offer
60
67
  switch :data, :data
61
68
  switch :claimable_balance, :claimable_balance
69
+ switch :liquidity_pool, :liquidity_pool
62
70
 
63
71
  attribute :account, Account
64
72
  attribute :trust_line, TrustLine
65
73
  attribute :offer, Offer
66
74
  attribute :data, Data
67
75
  attribute :claimable_balance, ClaimableBalance
76
+ attribute :liquidity_pool, LiquidityPool
68
77
  end
69
78
  end
@@ -15,6 +15,8 @@ require 'xdr'
15
15
  # uint32 newMaxTxSetSize; // update maxTxSetSize
16
16
  # case LEDGER_UPGRADE_BASE_RESERVE:
17
17
  # uint32 newBaseReserve; // update baseReserve
18
+ # case LEDGER_UPGRADE_FLAGS:
19
+ # uint32 newFlags; // update flags
18
20
  # };
19
21
  #
20
22
  # ===========================================================================
@@ -26,10 +28,12 @@ module Stellar
26
28
  switch :ledger_upgrade_base_fee, :new_base_fee
27
29
  switch :ledger_upgrade_max_tx_set_size, :new_max_tx_set_size
28
30
  switch :ledger_upgrade_base_reserve, :new_base_reserve
31
+ switch :ledger_upgrade_flags, :new_flags
29
32
 
30
33
  attribute :new_ledger_version, Uint32
31
34
  attribute :new_base_fee, Uint32
32
35
  attribute :new_max_tx_set_size, Uint32
33
36
  attribute :new_base_reserve, Uint32
37
+ attribute :new_flags, Uint32
34
38
  end
35
39
  end
@@ -10,7 +10,8 @@ require 'xdr'
10
10
  # LEDGER_UPGRADE_VERSION = 1,
11
11
  # LEDGER_UPGRADE_BASE_FEE = 2,
12
12
  # LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
13
- # LEDGER_UPGRADE_BASE_RESERVE = 4
13
+ # LEDGER_UPGRADE_BASE_RESERVE = 4,
14
+ # LEDGER_UPGRADE_FLAGS = 5
14
15
  # };
15
16
  #
16
17
  # ===========================================================================
@@ -20,6 +21,7 @@ module Stellar
20
21
  member :ledger_upgrade_base_fee, 2
21
22
  member :ledger_upgrade_max_tx_set_size, 3
22
23
  member :ledger_upgrade_base_reserve, 4
24
+ member :ledger_upgrade_flags, 5
23
25
 
24
26
  seal
25
27
  end
@@ -0,0 +1,22 @@
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 LiquidityPoolConstantProductParameters
9
+ # {
10
+ # Asset assetA; // assetA < assetB
11
+ # Asset assetB;
12
+ # int32 fee; // Fee is in basis points, so the actual rate is (fee/100)%
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class LiquidityPoolConstantProductParameters < XDR::Struct
18
+ attribute :asset_a, Asset
19
+ attribute :asset_b, Asset
20
+ attribute :fee, Int32
21
+ end
22
+ end
@@ -0,0 +1,26 @@
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 LiquidityPoolDepositOp
9
+ # {
10
+ # PoolID liquidityPoolID;
11
+ # int64 maxAmountA; // maximum amount of first asset to deposit
12
+ # int64 maxAmountB; // maximum amount of second asset to deposit
13
+ # Price minPrice; // minimum depositA/depositB
14
+ # Price maxPrice; // maximum depositA/depositB
15
+ # };
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class LiquidityPoolDepositOp < XDR::Struct
20
+ attribute :liquidity_pool_id, PoolID
21
+ attribute :max_amount_a, Int64
22
+ attribute :max_amount_b, Int64
23
+ attribute :min_price, Price
24
+ attribute :max_price, Price
25
+ end
26
+ end
@@ -0,0 +1,25 @@
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 LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code)
9
+ # {
10
+ # case LIQUIDITY_POOL_DEPOSIT_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class LiquidityPoolDepositResult < XDR::Union
19
+ switch_on LiquidityPoolDepositResultCode, :code
20
+
21
+ switch :liquidity_pool_deposit_success
22
+ switch :default
23
+
24
+ end
25
+ end
@@ -0,0 +1,41 @@
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 LiquidityPoolDepositResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0,
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input
15
+ # LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the
16
+ # // assets
17
+ # LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the
18
+ # // assets
19
+ # LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of
20
+ # // the assets
21
+ # LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't
22
+ # // have sufficient limit
23
+ # LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds
24
+ # LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full
25
+ # };
26
+ #
27
+ # ===========================================================================
28
+ module Stellar
29
+ class LiquidityPoolDepositResultCode < XDR::Enum
30
+ member :liquidity_pool_deposit_success, 0
31
+ member :liquidity_pool_deposit_malformed, -1
32
+ member :liquidity_pool_deposit_no_trust, -2
33
+ member :liquidity_pool_deposit_not_authorized, -3
34
+ member :liquidity_pool_deposit_underfunded, -4
35
+ member :liquidity_pool_deposit_line_full, -5
36
+ member :liquidity_pool_deposit_bad_price, -6
37
+ member :liquidity_pool_deposit_pool_full, -7
38
+
39
+ seal
40
+ end
41
+ 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
9
+ # {
10
+ # LiquidityPoolConstantProductParameters params;
11
+ #
12
+ # int64 reserveA; // amount of A in the pool
13
+ # int64 reserveB; // amount of B in the pool
14
+ # int64 totalPoolShares; // total number of pool shares issued
15
+ # int64 poolSharesTrustLineCount; // number of trust lines for the
16
+ # // associated pool shares
17
+ # }
18
+ #
19
+ # ===========================================================================
20
+ module Stellar
21
+ class LiquidityPoolEntry
22
+ class Body
23
+ class ConstantProduct < XDR::Struct
24
+ attribute :params, LiquidityPoolConstantProductParameters
25
+ attribute :reserve_a, Int64
26
+ attribute :reserve_b, Int64
27
+ attribute :total_pool_shares, Int64
28
+ attribute :pool_shares_trust_line_count, Int64
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,38 @@
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 (LiquidityPoolType type)
9
+ # {
10
+ # case LIQUIDITY_POOL_CONSTANT_PRODUCT:
11
+ # struct
12
+ # {
13
+ # LiquidityPoolConstantProductParameters params;
14
+ #
15
+ # int64 reserveA; // amount of A in the pool
16
+ # int64 reserveB; // amount of B in the pool
17
+ # int64 totalPoolShares; // total number of pool shares issued
18
+ # int64 poolSharesTrustLineCount; // number of trust lines for the
19
+ # // associated pool shares
20
+ # } constantProduct;
21
+ # }
22
+ #
23
+ # ===========================================================================
24
+ module Stellar
25
+ class LiquidityPoolEntry
26
+ class Body < XDR::Union
27
+ include XDR::Namespace
28
+
29
+ autoload :ConstantProduct
30
+
31
+ switch_on LiquidityPoolType, :type
32
+
33
+ switch :liquidity_pool_constant_product, :constant_product
34
+
35
+ attribute :constant_product, ConstantProduct
36
+ end
37
+ end
38
+ 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
+ # struct LiquidityPoolEntry
9
+ # {
10
+ # PoolID liquidityPoolID;
11
+ #
12
+ # union switch (LiquidityPoolType type)
13
+ # {
14
+ # case LIQUIDITY_POOL_CONSTANT_PRODUCT:
15
+ # struct
16
+ # {
17
+ # LiquidityPoolConstantProductParameters params;
18
+ #
19
+ # int64 reserveA; // amount of A in the pool
20
+ # int64 reserveB; // amount of B in the pool
21
+ # int64 totalPoolShares; // total number of pool shares issued
22
+ # int64 poolSharesTrustLineCount; // number of trust lines for the
23
+ # // associated pool shares
24
+ # } constantProduct;
25
+ # }
26
+ # body;
27
+ # };
28
+ #
29
+ # ===========================================================================
30
+ module Stellar
31
+ class LiquidityPoolEntry < XDR::Struct
32
+ include XDR::Namespace
33
+
34
+ autoload :Body
35
+
36
+ attribute :liquidity_pool_id, PoolID
37
+ attribute :body, Body
38
+ end
39
+ end
@@ -0,0 +1,23 @@
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 LiquidityPoolParameters switch (LiquidityPoolType type)
9
+ # {
10
+ # case LIQUIDITY_POOL_CONSTANT_PRODUCT:
11
+ # LiquidityPoolConstantProductParameters constantProduct;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class LiquidityPoolParameters < XDR::Union
17
+ switch_on LiquidityPoolType, :type
18
+
19
+ switch :liquidity_pool_constant_product, :constant_product
20
+
21
+ attribute :constant_product, LiquidityPoolConstantProductParameters
22
+ end
23
+ 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
+ # enum LiquidityPoolType
9
+ # {
10
+ # LIQUIDITY_POOL_CONSTANT_PRODUCT = 0
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class LiquidityPoolType < XDR::Enum
16
+ member :liquidity_pool_constant_product, 0
17
+
18
+ seal
19
+ end
20
+ 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
+ # struct LiquidityPoolWithdrawOp
9
+ # {
10
+ # PoolID liquidityPoolID;
11
+ # int64 amount; // amount of pool shares to withdraw
12
+ # int64 minAmountA; // minimum amount of first asset to withdraw
13
+ # int64 minAmountB; // minimum amount of second asset to withdraw
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class LiquidityPoolWithdrawOp < XDR::Struct
19
+ attribute :liquidity_pool_id, PoolID
20
+ attribute :amount, Int64
21
+ attribute :min_amount_a, Int64
22
+ attribute :min_amount_b, Int64
23
+ end
24
+ end
@@ -0,0 +1,25 @@
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 LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code)
9
+ # {
10
+ # case LIQUIDITY_POOL_WITHDRAW_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class LiquidityPoolWithdrawResult < XDR::Union
19
+ switch_on LiquidityPoolWithdrawResultCode, :code
20
+
21
+ switch :liquidity_pool_withdraw_success
22
+ switch :default
23
+
24
+ end
25
+ end
@@ -0,0 +1,36 @@
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 LiquidityPoolWithdrawResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0,
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input
15
+ # LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the
16
+ # // assets
17
+ # LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the
18
+ # // pool share
19
+ # LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one
20
+ # // of the assets
21
+ # LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough
22
+ # };
23
+ #
24
+ # ===========================================================================
25
+ module Stellar
26
+ class LiquidityPoolWithdrawResultCode < XDR::Enum
27
+ member :liquidity_pool_withdraw_success, 0
28
+ member :liquidity_pool_withdraw_malformed, -1
29
+ member :liquidity_pool_withdraw_no_trust, -2
30
+ member :liquidity_pool_withdraw_underfunded, -3
31
+ member :liquidity_pool_withdraw_line_full, -4
32
+ member :liquidity_pool_withdraw_under_minimum, -5
33
+
34
+ seal
35
+ end
36
+ end