stellar-base 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -32
  3. data/README.md +3 -3
  4. data/generated/stellar-base-generated.rb +15 -0
  5. data/generated/stellar/account_flags.rb +9 -4
  6. data/generated/stellar/account_merge_result.rb +1 -1
  7. data/generated/stellar/allow_trust_op.rb +3 -18
  8. data/generated/stellar/asset_code.rb +30 -0
  9. data/generated/stellar/begin_sponsoring_future_reserves_result.rb +2 -1
  10. data/generated/stellar/claimable_balance_entry.rb +2 -0
  11. data/generated/stellar/claimable_balance_entry/ext.rb +4 -0
  12. data/generated/stellar/claimable_balance_entry_extension_v1.rb +30 -0
  13. data/generated/stellar/claimable_balance_entry_extension_v1/ext.rb +24 -0
  14. data/generated/stellar/claimable_balance_flags.rb +22 -0
  15. data/generated/stellar/clawback_claimable_balance_op.rb +18 -0
  16. data/generated/stellar/clawback_claimable_balance_result.rb +26 -0
  17. data/generated/stellar/clawback_claimable_balance_result_code.rb +29 -0
  18. data/generated/stellar/clawback_op.rb +22 -0
  19. data/generated/stellar/clawback_result.rb +25 -0
  20. data/generated/stellar/clawback_result_code.rb +31 -0
  21. data/generated/stellar/create_passive_sell_offer_op.rb +1 -1
  22. data/generated/stellar/end_sponsoring_future_reserves_result.rb +2 -1
  23. data/generated/stellar/operation.rb +6 -0
  24. data/generated/stellar/operation/body.rb +12 -0
  25. data/generated/stellar/operation_result.rb +6 -0
  26. data/generated/stellar/operation_result/tr.rb +12 -0
  27. data/generated/stellar/operation_type.rb +7 -1
  28. data/generated/stellar/payment_result_code.rb +1 -1
  29. data/generated/stellar/revoke_sponsorship_op.rb +1 -2
  30. data/generated/stellar/set_options_result_code.rb +14 -11
  31. data/generated/stellar/set_trust_line_flags_op.rb +25 -0
  32. data/generated/stellar/set_trust_line_flags_result.rb +25 -0
  33. data/generated/stellar/set_trust_line_flags_result_code.rb +31 -0
  34. data/generated/stellar/transaction_result_code.rb +1 -1
  35. data/generated/stellar/trust_line_flags.rb +5 -1
  36. data/lib/stellar-base.rb +2 -2
  37. data/lib/stellar/compat.rb +2 -1
  38. data/lib/stellar/concerns/transaction.rb +4 -2
  39. data/lib/stellar/dsl.rb +4 -0
  40. data/lib/stellar/operation.rb +85 -16
  41. data/lib/stellar/trust_line_flags.rb +53 -0
  42. data/lib/stellar/version.rb +3 -0
  43. metadata +27 -12
  44. data/generated/stellar/allow_trust_op/asset.rb +0 -33
  45. data/lib/stellar/base/version.rb +0 -5
@@ -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
+ # union switch (int v)
9
+ # {
10
+ # case 0:
11
+ # void;
12
+ # }
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class ClaimableBalanceEntryExtensionV1
17
+ class Ext < XDR::Union
18
+ switch_on XDR::Int, :v
19
+
20
+ switch 0
21
+
22
+ end
23
+ end
24
+ 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
+ # enum ClaimableBalanceFlags
9
+ # {
10
+ # // If set, the issuer account of the asset held by the claimable balance may
11
+ # // clawback the claimable balance
12
+ # CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class ClaimableBalanceFlags < XDR::Enum
18
+ member :claimable_balance_clawback_enabled_flag, 1
19
+
20
+ seal
21
+ end
22
+ end
@@ -0,0 +1,18 @@
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 ClawbackClaimableBalanceOp
9
+ # {
10
+ # ClaimableBalanceID balanceID;
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class ClawbackClaimableBalanceOp < XDR::Struct
16
+ attribute :balance_id, ClaimableBalanceID
17
+ end
18
+ 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
+ # union ClawbackClaimableBalanceResult switch (
9
+ # ClawbackClaimableBalanceResultCode code)
10
+ # {
11
+ # case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS:
12
+ # void;
13
+ # default:
14
+ # void;
15
+ # };
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class ClawbackClaimableBalanceResult < XDR::Union
20
+ switch_on ClawbackClaimableBalanceResultCode, :code
21
+
22
+ switch :clawback_claimable_balance_success
23
+ switch :default
24
+
25
+ end
26
+ end
@@ -0,0 +1,29 @@
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 ClawbackClaimableBalanceResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0,
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1,
15
+ # CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2,
16
+ # CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3
17
+ # };
18
+ #
19
+ # ===========================================================================
20
+ module Stellar
21
+ class ClawbackClaimableBalanceResultCode < XDR::Enum
22
+ member :clawback_claimable_balance_success, 0
23
+ member :clawback_claimable_balance_does_not_exist, -1
24
+ member :clawback_claimable_balance_not_issuer, -2
25
+ member :clawback_claimable_balance_not_clawback_enabled, -3
26
+
27
+ seal
28
+ end
29
+ 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 ClawbackOp
9
+ # {
10
+ # Asset asset;
11
+ # MuxedAccount from;
12
+ # int64 amount;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class ClawbackOp < XDR::Struct
18
+ attribute :asset, Asset
19
+ attribute :from, MuxedAccount
20
+ attribute :amount, Int64
21
+ end
22
+ 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 ClawbackResult switch (ClawbackResultCode code)
9
+ # {
10
+ # case CLAWBACK_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class ClawbackResult < XDR::Union
19
+ switch_on ClawbackResultCode, :code
20
+
21
+ switch :clawback_success
22
+ switch :default
23
+
24
+ end
25
+ 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
+ # enum ClawbackResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # CLAWBACK_SUCCESS = 0,
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # CLAWBACK_MALFORMED = -1,
15
+ # CLAWBACK_NOT_CLAWBACK_ENABLED = -2,
16
+ # CLAWBACK_NO_TRUST = -3,
17
+ # CLAWBACK_UNDERFUNDED = -4
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class ClawbackResultCode < XDR::Enum
23
+ member :clawback_success, 0
24
+ member :clawback_malformed, -1
25
+ member :clawback_not_clawback_enabled, -2
26
+ member :clawback_no_trust, -3
27
+ member :clawback_underfunded, -4
28
+
29
+ seal
30
+ end
31
+ end
@@ -9,7 +9,7 @@ require 'xdr'
9
9
  # {
10
10
  # Asset selling; // A
11
11
  # Asset buying; // B
12
- # int64 amount; // amount taker gets. if set to 0, delete the offer
12
+ # int64 amount; // amount taker gets
13
13
  # Price price; // cost of A in terms of B
14
14
  # };
15
15
  #
@@ -5,7 +5,8 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # union EndSponsoringFutureReservesResult switch (EndSponsoringFutureReservesResultCode code)
8
+ # union EndSponsoringFutureReservesResult switch (
9
+ # EndSponsoringFutureReservesResultCode code)
9
10
  # {
10
11
  # case END_SPONSORING_FUTURE_RESERVES_SUCCESS:
11
12
  # void;
@@ -52,6 +52,12 @@ require 'xdr'
52
52
  # void;
53
53
  # case REVOKE_SPONSORSHIP:
54
54
  # RevokeSponsorshipOp revokeSponsorshipOp;
55
+ # case CLAWBACK:
56
+ # ClawbackOp clawbackOp;
57
+ # case CLAWBACK_CLAIMABLE_BALANCE:
58
+ # ClawbackClaimableBalanceOp clawbackClaimableBalanceOp;
59
+ # case SET_TRUST_LINE_FLAGS:
60
+ # SetTrustLineFlagsOp setTrustLineFlagsOp;
55
61
  # }
56
62
  # body;
57
63
  # };
@@ -45,6 +45,12 @@ require 'xdr'
45
45
  # void;
46
46
  # case REVOKE_SPONSORSHIP:
47
47
  # RevokeSponsorshipOp revokeSponsorshipOp;
48
+ # case CLAWBACK:
49
+ # ClawbackOp clawbackOp;
50
+ # case CLAWBACK_CLAIMABLE_BALANCE:
51
+ # ClawbackClaimableBalanceOp clawbackClaimableBalanceOp;
52
+ # case SET_TRUST_LINE_FLAGS:
53
+ # SetTrustLineFlagsOp setTrustLineFlagsOp;
48
54
  # }
49
55
  #
50
56
  # ===========================================================================
@@ -72,6 +78,9 @@ module Stellar
72
78
  switch :begin_sponsoring_future_reserves, :begin_sponsoring_future_reserves_op
73
79
  switch :end_sponsoring_future_reserves
74
80
  switch :revoke_sponsorship, :revoke_sponsorship_op
81
+ switch :clawback, :clawback_op
82
+ switch :clawback_claimable_balance, :clawback_claimable_balance_op
83
+ switch :set_trust_line_flags, :set_trust_line_flags_op
75
84
 
76
85
  attribute :create_account_op, CreateAccountOp
77
86
  attribute :payment_op, PaymentOp
@@ -90,6 +99,9 @@ module Stellar
90
99
  attribute :claim_claimable_balance_op, ClaimClaimableBalanceOp
91
100
  attribute :begin_sponsoring_future_reserves_op, BeginSponsoringFutureReservesOp
92
101
  attribute :revoke_sponsorship_op, RevokeSponsorshipOp
102
+ attribute :clawback_op, ClawbackOp
103
+ attribute :clawback_claimable_balance_op, ClawbackClaimableBalanceOp
104
+ attribute :set_trust_line_flags_op, SetTrustLineFlagsOp
93
105
  end
94
106
  end
95
107
  end
@@ -48,6 +48,12 @@ require 'xdr'
48
48
  # EndSponsoringFutureReservesResult endSponsoringFutureReservesResult;
49
49
  # case REVOKE_SPONSORSHIP:
50
50
  # RevokeSponsorshipResult revokeSponsorshipResult;
51
+ # case CLAWBACK:
52
+ # ClawbackResult clawbackResult;
53
+ # case CLAWBACK_CLAIMABLE_BALANCE:
54
+ # ClawbackClaimableBalanceResult clawbackClaimableBalanceResult;
55
+ # case SET_TRUST_LINE_FLAGS:
56
+ # SetTrustLineFlagsResult setTrustLineFlagsResult;
51
57
  # }
52
58
  # tr;
53
59
  # default:
@@ -45,6 +45,12 @@ require 'xdr'
45
45
  # EndSponsoringFutureReservesResult endSponsoringFutureReservesResult;
46
46
  # case REVOKE_SPONSORSHIP:
47
47
  # RevokeSponsorshipResult revokeSponsorshipResult;
48
+ # case CLAWBACK:
49
+ # ClawbackResult clawbackResult;
50
+ # case CLAWBACK_CLAIMABLE_BALANCE:
51
+ # ClawbackClaimableBalanceResult clawbackClaimableBalanceResult;
52
+ # case SET_TRUST_LINE_FLAGS:
53
+ # SetTrustLineFlagsResult setTrustLineFlagsResult;
48
54
  # }
49
55
  #
50
56
  # ===========================================================================
@@ -72,6 +78,9 @@ module Stellar
72
78
  switch :begin_sponsoring_future_reserves, :begin_sponsoring_future_reserves_result
73
79
  switch :end_sponsoring_future_reserves, :end_sponsoring_future_reserves_result
74
80
  switch :revoke_sponsorship, :revoke_sponsorship_result
81
+ switch :clawback, :clawback_result
82
+ switch :clawback_claimable_balance, :clawback_claimable_balance_result
83
+ switch :set_trust_line_flags, :set_trust_line_flags_result
75
84
 
76
85
  attribute :create_account_result, CreateAccountResult
77
86
  attribute :payment_result, PaymentResult
@@ -92,6 +101,9 @@ module Stellar
92
101
  attribute :begin_sponsoring_future_reserves_result, BeginSponsoringFutureReservesResult
93
102
  attribute :end_sponsoring_future_reserves_result, EndSponsoringFutureReservesResult
94
103
  attribute :revoke_sponsorship_result, RevokeSponsorshipResult
104
+ attribute :clawback_result, ClawbackResult
105
+ attribute :clawback_claimable_balance_result, ClawbackClaimableBalanceResult
106
+ attribute :set_trust_line_flags_result, SetTrustLineFlagsResult
95
107
  end
96
108
  end
97
109
  end
@@ -25,7 +25,10 @@ require 'xdr'
25
25
  # CLAIM_CLAIMABLE_BALANCE = 15,
26
26
  # BEGIN_SPONSORING_FUTURE_RESERVES = 16,
27
27
  # END_SPONSORING_FUTURE_RESERVES = 17,
28
- # REVOKE_SPONSORSHIP = 18
28
+ # REVOKE_SPONSORSHIP = 18,
29
+ # CLAWBACK = 19,
30
+ # CLAWBACK_CLAIMABLE_BALANCE = 20,
31
+ # SET_TRUST_LINE_FLAGS = 21
29
32
  # };
30
33
  #
31
34
  # ===========================================================================
@@ -50,6 +53,9 @@ module Stellar
50
53
  member :begin_sponsoring_future_reserves, 16
51
54
  member :end_sponsoring_future_reserves, 17
52
55
  member :revoke_sponsorship, 18
56
+ member :clawback, 19
57
+ member :clawback_claimable_balance, 20
58
+ member :set_trust_line_flags, 21
53
59
 
54
60
  seal
55
61
  end
@@ -8,7 +8,7 @@ require 'xdr'
8
8
  # enum PaymentResultCode
9
9
  # {
10
10
  # // codes considered as "success" for the operation
11
- # PAYMENT_SUCCESS = 0, // payment successfuly completed
11
+ # PAYMENT_SUCCESS = 0, // payment successfully completed
12
12
  #
13
13
  # // codes considered as "failure" for the operation
14
14
  # PAYMENT_MALFORMED = -1, // bad input
@@ -14,8 +14,7 @@ require 'xdr'
14
14
  # {
15
15
  # AccountID accountID;
16
16
  # SignerKey signerKey;
17
- # }
18
- # signer;
17
+ # } signer;
19
18
  # };
20
19
  #
21
20
  # ===========================================================================
@@ -18,22 +18,25 @@ require 'xdr'
18
18
  # SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag
19
19
  # SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
20
20
  # SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey
21
- # SET_OPTIONS_INVALID_HOME_DOMAIN = -9 // malformed home domain
21
+ # SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain
22
+ # SET_OPTIONS_AUTH_REVOCABLE_REQUIRED =
23
+ # -10 // auth revocable is required for clawback
22
24
  # };
23
25
  #
24
26
  # ===========================================================================
25
27
  module Stellar
26
28
  class SetOptionsResultCode < XDR::Enum
27
- member :set_options_success, 0
28
- member :set_options_low_reserve, -1
29
- member :set_options_too_many_signers, -2
30
- member :set_options_bad_flags, -3
31
- member :set_options_invalid_inflation, -4
32
- member :set_options_cant_change, -5
33
- member :set_options_unknown_flag, -6
34
- member :set_options_threshold_out_of_range, -7
35
- member :set_options_bad_signer, -8
36
- member :set_options_invalid_home_domain, -9
29
+ member :set_options_success, 0
30
+ member :set_options_low_reserve, -1
31
+ member :set_options_too_many_signers, -2
32
+ member :set_options_bad_flags, -3
33
+ member :set_options_invalid_inflation, -4
34
+ member :set_options_cant_change, -5
35
+ member :set_options_unknown_flag, -6
36
+ member :set_options_threshold_out_of_range, -7
37
+ member :set_options_bad_signer, -8
38
+ member :set_options_invalid_home_domain, -9
39
+ member :set_options_auth_revocable_required, -10
37
40
 
38
41
  seal
39
42
  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
+ # struct SetTrustLineFlagsOp
9
+ # {
10
+ # AccountID trustor;
11
+ # Asset asset;
12
+ #
13
+ # uint32 clearFlags; // which flags to clear
14
+ # uint32 setFlags; // which flags to set
15
+ # };
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class SetTrustLineFlagsOp < XDR::Struct
20
+ attribute :trustor, AccountID
21
+ attribute :asset, Asset
22
+ attribute :clear_flags, Uint32
23
+ attribute :set_flags, Uint32
24
+ end
25
+ 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 SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code)
9
+ # {
10
+ # case SET_TRUST_LINE_FLAGS_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SetTrustLineFlagsResult < XDR::Union
19
+ switch_on SetTrustLineFlagsResultCode, :code
20
+
21
+ switch :set_trust_line_flags_success
22
+ switch :default
23
+
24
+ end
25
+ end