stellar-base 0.23.1 → 0.24.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +88 -0
  3. data/generated/stellar-base-generated.rb +29 -1
  4. data/generated/stellar/account_entry.rb +3 -13
  5. data/generated/stellar/account_entry/ext.rb +2 -16
  6. data/generated/stellar/account_entry_extension_v1.rb +32 -0
  7. data/generated/stellar/account_entry_extension_v1/ext.rb +28 -0
  8. data/generated/stellar/account_entry_extension_v2.rb +34 -0
  9. data/generated/stellar/{account_entry/ext/v1 → account_entry_extension_v2}/ext.rb +8 -12
  10. data/generated/stellar/account_merge_result_code.rb +3 -1
  11. data/generated/stellar/begin_sponsoring_future_reserves_op.rb +18 -0
  12. data/generated/stellar/begin_sponsoring_future_reserves_result.rb +25 -0
  13. data/generated/stellar/begin_sponsoring_future_reserves_result_code.rb +29 -0
  14. data/generated/stellar/claim_claimable_balance_op.rb +18 -0
  15. data/generated/stellar/claim_claimable_balance_result.rb +25 -0
  16. data/generated/stellar/claim_claimable_balance_result_code.rb +31 -0
  17. data/generated/stellar/claim_predicate.rb +43 -0
  18. data/generated/stellar/claim_predicate_type.rb +30 -0
  19. data/generated/stellar/claimable_balance_entry.rb +44 -0
  20. data/generated/stellar/claimable_balance_entry/ext.rb +24 -0
  21. data/generated/stellar/claimable_balance_id.rb +23 -0
  22. data/generated/stellar/claimable_balance_id_type.rb +20 -0
  23. data/generated/stellar/claimant.rb +31 -0
  24. data/generated/stellar/claimant/v0.rb +22 -0
  25. data/generated/stellar/claimant_type.rb +20 -0
  26. data/generated/stellar/create_claimable_balance_op.rb +22 -0
  27. data/generated/stellar/create_claimable_balance_result.rb +27 -0
  28. data/generated/stellar/create_claimable_balance_result_code.rb +30 -0
  29. data/generated/stellar/end_sponsoring_future_reserves_result.rb +25 -0
  30. data/generated/stellar/end_sponsoring_future_reserves_result_code.rb +25 -0
  31. data/generated/stellar/envelope_type.rb +3 -1
  32. data/generated/stellar/inner_transaction_result.rb +2 -1
  33. data/generated/stellar/inner_transaction_result/result.rb +3 -1
  34. data/generated/stellar/ledger_entry.rb +4 -0
  35. data/generated/stellar/ledger_entry/data.rb +12 -8
  36. data/generated/stellar/ledger_entry/ext.rb +4 -0
  37. data/generated/stellar/ledger_entry_extension_v1.rb +30 -0
  38. data/generated/stellar/ledger_entry_extension_v1/ext.rb +24 -0
  39. data/generated/stellar/ledger_entry_type.rb +7 -5
  40. data/generated/stellar/ledger_key.rb +17 -8
  41. data/generated/stellar/ledger_key/claimable_balance.rb +20 -0
  42. data/generated/stellar/operation.rb +10 -0
  43. data/generated/stellar/operation/body.rb +45 -26
  44. data/generated/stellar/operation_id.rb +32 -0
  45. data/generated/stellar/operation_id/id.rb +24 -0
  46. data/generated/stellar/operation_result.rb +10 -0
  47. data/generated/stellar/operation_result/tr.rb +48 -28
  48. data/generated/stellar/operation_result_code.rb +3 -1
  49. data/generated/stellar/operation_type.rb +25 -15
  50. data/generated/stellar/path_payment_strict_receive_result.rb +2 -1
  51. data/generated/stellar/revoke_sponsorship_op.rb +36 -0
  52. data/generated/stellar/revoke_sponsorship_op/signer.rb +22 -0
  53. data/generated/stellar/revoke_sponsorship_result.rb +25 -0
  54. data/generated/stellar/revoke_sponsorship_result_code.rb +31 -0
  55. data/generated/stellar/revoke_sponsorship_type.rb +22 -0
  56. data/generated/stellar/transaction_result_code.rb +4 -2
  57. data/lib/stellar-base.rb +15 -5
  58. data/lib/stellar/account_flags.rb +1 -1
  59. data/lib/stellar/{version.rb → base/version.rb} +1 -1
  60. data/lib/stellar/claim_predicate.rb +198 -0
  61. data/lib/stellar/compat.rb +2 -11
  62. data/lib/stellar/dsl.rb +85 -0
  63. data/lib/stellar/ext/xdr.rb +49 -0
  64. data/lib/stellar/key_pair.rb +43 -35
  65. data/lib/stellar/ledger_key.rb +30 -0
  66. data/lib/stellar/networks.rb +12 -12
  67. data/lib/stellar/operation.rb +58 -1
  68. data/lib/stellar/price.rb +11 -2
  69. data/lib/stellar/transaction.rb +0 -168
  70. data/lib/stellar/transaction_builder.rb +28 -2
  71. data/lib/stellar/transaction_envelope.rb +3 -29
  72. data/lib/stellar/util/strkey.rb +6 -6
  73. metadata +162 -32
  74. data/generated/stellar/account_entry/ext/v1.rb +0 -34
  75. data/lib/stellar/util/continued_fraction.rb +0 -96
@@ -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
+ # enum EndSponsoringFutureReservesResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0,
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1
15
+ # };
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class EndSponsoringFutureReservesResultCode < XDR::Enum
20
+ member :end_sponsoring_future_reserves_success, 0
21
+ member :end_sponsoring_future_reserves_not_sponsored, -1
22
+
23
+ seal
24
+ end
25
+ end
@@ -12,7 +12,8 @@ require 'xdr'
12
12
  # ENVELOPE_TYPE_TX = 2,
13
13
  # ENVELOPE_TYPE_AUTH = 3,
14
14
  # ENVELOPE_TYPE_SCPVALUE = 4,
15
- # ENVELOPE_TYPE_TX_FEE_BUMP = 5
15
+ # ENVELOPE_TYPE_TX_FEE_BUMP = 5,
16
+ # ENVELOPE_TYPE_OP_ID = 6
16
17
  # };
17
18
  #
18
19
  # ===========================================================================
@@ -24,6 +25,7 @@ module Stellar
24
25
  member :envelope_type_auth, 3
25
26
  member :envelope_type_scpvalue, 4
26
27
  member :envelope_type_tx_fee_bump, 5
28
+ member :envelope_type_op_id, 6
27
29
 
28
30
  seal
29
31
  end
@@ -27,7 +27,8 @@ require 'xdr'
27
27
  # case txBAD_AUTH_EXTRA:
28
28
  # case txINTERNAL_ERROR:
29
29
  # case txNOT_SUPPORTED:
30
- # // txFEE_BUMP_INNER_FAILED is not included
30
+ # // txFEE_BUMP_INNER_FAILED is not included
31
+ # case txBAD_SPONSORSHIP:
31
32
  # void;
32
33
  # }
33
34
  # result;
@@ -22,7 +22,8 @@ require 'xdr'
22
22
  # case txBAD_AUTH_EXTRA:
23
23
  # case txINTERNAL_ERROR:
24
24
  # case txNOT_SUPPORTED:
25
- # // txFEE_BUMP_INNER_FAILED is not included
25
+ # // txFEE_BUMP_INNER_FAILED is not included
26
+ # case txBAD_SPONSORSHIP:
26
27
  # void;
27
28
  # }
28
29
  #
@@ -45,6 +46,7 @@ module Stellar
45
46
  switch :tx_bad_auth_extra
46
47
  switch :tx_internal_error
47
48
  switch :tx_not_supported
49
+ switch :tx_bad_sponsorship
48
50
 
49
51
  attribute :results, XDR::VarArray[OperationResult]
50
52
  end
@@ -19,6 +19,8 @@ require 'xdr'
19
19
  # OfferEntry offer;
20
20
  # case DATA:
21
21
  # DataEntry data;
22
+ # case CLAIMABLE_BALANCE:
23
+ # ClaimableBalanceEntry claimableBalance;
22
24
  # }
23
25
  # data;
24
26
  #
@@ -27,6 +29,8 @@ require 'xdr'
27
29
  # {
28
30
  # case 0:
29
31
  # void;
32
+ # case 1:
33
+ # LedgerEntryExtensionV1 v1;
30
34
  # }
31
35
  # ext;
32
36
  # };
@@ -15,6 +15,8 @@ require 'xdr'
15
15
  # OfferEntry offer;
16
16
  # case DATA:
17
17
  # DataEntry data;
18
+ # case CLAIMABLE_BALANCE:
19
+ # ClaimableBalanceEntry claimableBalance;
18
20
  # }
19
21
  #
20
22
  # ===========================================================================
@@ -23,15 +25,17 @@ module Stellar
23
25
  class Data < XDR::Union
24
26
  switch_on LedgerEntryType, :type
25
27
 
26
- switch :account, :account
27
- switch :trustline, :trust_line
28
- switch :offer, :offer
29
- switch :data, :data
28
+ switch :account, :account
29
+ switch :trustline, :trust_line
30
+ switch :offer, :offer
31
+ switch :data, :data
32
+ switch :claimable_balance, :claimable_balance
30
33
 
31
- attribute :account, AccountEntry
32
- attribute :trust_line, TrustLineEntry
33
- attribute :offer, OfferEntry
34
- attribute :data, DataEntry
34
+ attribute :account, AccountEntry
35
+ attribute :trust_line, TrustLineEntry
36
+ attribute :offer, OfferEntry
37
+ attribute :data, DataEntry
38
+ attribute :claimable_balance, ClaimableBalanceEntry
35
39
  end
36
40
  end
37
41
  end
@@ -9,6 +9,8 @@ require 'xdr'
9
9
  # {
10
10
  # case 0:
11
11
  # void;
12
+ # case 1:
13
+ # LedgerEntryExtensionV1 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, LedgerEntryExtensionV1
22
26
  end
23
27
  end
24
28
  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 LedgerEntryExtensionV1
9
+ # {
10
+ # SponsorshipDescriptor sponsoringID;
11
+ #
12
+ # union switch (int v)
13
+ # {
14
+ # case 0:
15
+ # void;
16
+ # }
17
+ # ext;
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class LedgerEntryExtensionV1 < XDR::Struct
23
+ include XDR::Namespace
24
+
25
+ autoload :Ext
26
+
27
+ attribute :sponsoring_id, SponsorshipDescriptor
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
+ # union switch (int v)
9
+ # {
10
+ # case 0:
11
+ # void;
12
+ # }
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class LedgerEntryExtensionV1
17
+ class Ext < XDR::Union
18
+ switch_on XDR::Int, :v
19
+
20
+ switch 0
21
+
22
+ end
23
+ end
24
+ end
@@ -10,16 +10,18 @@ require 'xdr'
10
10
  # ACCOUNT = 0,
11
11
  # TRUSTLINE = 1,
12
12
  # OFFER = 2,
13
- # DATA = 3
13
+ # DATA = 3,
14
+ # CLAIMABLE_BALANCE = 4
14
15
  # };
15
16
  #
16
17
  # ===========================================================================
17
18
  module Stellar
18
19
  class LedgerEntryType < XDR::Enum
19
- member :account, 0
20
- member :trustline, 1
21
- member :offer, 2
22
- member :data, 3
20
+ member :account, 0
21
+ member :trustline, 1
22
+ member :offer, 2
23
+ member :data, 3
24
+ member :claimable_balance, 4
23
25
 
24
26
  seal
25
27
  end
@@ -33,6 +33,12 @@ require 'xdr'
33
33
  # AccountID accountID;
34
34
  # string64 dataName;
35
35
  # } data;
36
+ #
37
+ # case CLAIMABLE_BALANCE:
38
+ # struct
39
+ # {
40
+ # ClaimableBalanceID balanceID;
41
+ # } claimableBalance;
36
42
  # };
37
43
  #
38
44
  # ===========================================================================
@@ -44,17 +50,20 @@ module Stellar
44
50
  autoload :TrustLine
45
51
  autoload :Offer
46
52
  autoload :Data
53
+ autoload :ClaimableBalance
47
54
 
48
55
  switch_on LedgerEntryType, :type
49
56
 
50
- switch :account, :account
51
- switch :trustline, :trust_line
52
- switch :offer, :offer
53
- switch :data, :data
57
+ switch :account, :account
58
+ switch :trustline, :trust_line
59
+ switch :offer, :offer
60
+ switch :data, :data
61
+ switch :claimable_balance, :claimable_balance
54
62
 
55
- attribute :account, Account
56
- attribute :trust_line, TrustLine
57
- attribute :offer, Offer
58
- attribute :data, Data
63
+ attribute :account, Account
64
+ attribute :trust_line, TrustLine
65
+ attribute :offer, Offer
66
+ attribute :data, Data
67
+ attribute :claimable_balance, ClaimableBalance
59
68
  end
60
69
  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
9
+ # {
10
+ # ClaimableBalanceID balanceID;
11
+ # }
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class LedgerKey
16
+ class ClaimableBalance < XDR::Struct
17
+ attribute :balance_id, ClaimableBalanceID
18
+ end
19
+ end
20
+ end
@@ -42,6 +42,16 @@ require 'xdr'
42
42
  # ManageBuyOfferOp manageBuyOfferOp;
43
43
  # case PATH_PAYMENT_STRICT_SEND:
44
44
  # PathPaymentStrictSendOp pathPaymentStrictSendOp;
45
+ # case CREATE_CLAIMABLE_BALANCE:
46
+ # CreateClaimableBalanceOp createClaimableBalanceOp;
47
+ # case CLAIM_CLAIMABLE_BALANCE:
48
+ # ClaimClaimableBalanceOp claimClaimableBalanceOp;
49
+ # case BEGIN_SPONSORING_FUTURE_RESERVES:
50
+ # BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp;
51
+ # case END_SPONSORING_FUTURE_RESERVES:
52
+ # void;
53
+ # case REVOKE_SPONSORSHIP:
54
+ # RevokeSponsorshipOp revokeSponsorshipOp;
45
55
  # }
46
56
  # body;
47
57
  # };
@@ -35,6 +35,16 @@ require 'xdr'
35
35
  # ManageBuyOfferOp manageBuyOfferOp;
36
36
  # case PATH_PAYMENT_STRICT_SEND:
37
37
  # PathPaymentStrictSendOp pathPaymentStrictSendOp;
38
+ # case CREATE_CLAIMABLE_BALANCE:
39
+ # CreateClaimableBalanceOp createClaimableBalanceOp;
40
+ # case CLAIM_CLAIMABLE_BALANCE:
41
+ # ClaimClaimableBalanceOp claimClaimableBalanceOp;
42
+ # case BEGIN_SPONSORING_FUTURE_RESERVES:
43
+ # BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp;
44
+ # case END_SPONSORING_FUTURE_RESERVES:
45
+ # void;
46
+ # case REVOKE_SPONSORSHIP:
47
+ # RevokeSponsorshipOp revokeSponsorshipOp;
38
48
  # }
39
49
  #
40
50
  # ===========================================================================
@@ -43,34 +53,43 @@ module Stellar
43
53
  class Body < XDR::Union
44
54
  switch_on OperationType, :type
45
55
 
46
- switch :create_account, :create_account_op
47
- switch :payment, :payment_op
48
- switch :path_payment_strict_receive, :path_payment_strict_receive_op
49
- switch :manage_sell_offer, :manage_sell_offer_op
50
- switch :create_passive_sell_offer, :create_passive_sell_offer_op
51
- switch :set_options, :set_options_op
52
- switch :change_trust, :change_trust_op
53
- switch :allow_trust, :allow_trust_op
54
- switch :account_merge, :destination
56
+ switch :create_account, :create_account_op
57
+ switch :payment, :payment_op
58
+ switch :path_payment_strict_receive, :path_payment_strict_receive_op
59
+ switch :manage_sell_offer, :manage_sell_offer_op
60
+ switch :create_passive_sell_offer, :create_passive_sell_offer_op
61
+ switch :set_options, :set_options_op
62
+ switch :change_trust, :change_trust_op
63
+ switch :allow_trust, :allow_trust_op
64
+ switch :account_merge, :destination
55
65
  switch :inflation
56
- switch :manage_data, :manage_data_op
57
- switch :bump_sequence, :bump_sequence_op
58
- switch :manage_buy_offer, :manage_buy_offer_op
59
- switch :path_payment_strict_send, :path_payment_strict_send_op
66
+ switch :manage_data, :manage_data_op
67
+ switch :bump_sequence, :bump_sequence_op
68
+ switch :manage_buy_offer, :manage_buy_offer_op
69
+ switch :path_payment_strict_send, :path_payment_strict_send_op
70
+ switch :create_claimable_balance, :create_claimable_balance_op
71
+ switch :claim_claimable_balance, :claim_claimable_balance_op
72
+ switch :begin_sponsoring_future_reserves, :begin_sponsoring_future_reserves_op
73
+ switch :end_sponsoring_future_reserves
74
+ switch :revoke_sponsorship, :revoke_sponsorship_op
60
75
 
61
- attribute :create_account_op, CreateAccountOp
62
- attribute :payment_op, PaymentOp
63
- attribute :path_payment_strict_receive_op, PathPaymentStrictReceiveOp
64
- attribute :manage_sell_offer_op, ManageSellOfferOp
65
- attribute :create_passive_sell_offer_op, CreatePassiveSellOfferOp
66
- attribute :set_options_op, SetOptionsOp
67
- attribute :change_trust_op, ChangeTrustOp
68
- attribute :allow_trust_op, AllowTrustOp
69
- attribute :destination, MuxedAccount
70
- attribute :manage_data_op, ManageDataOp
71
- attribute :bump_sequence_op, BumpSequenceOp
72
- attribute :manage_buy_offer_op, ManageBuyOfferOp
73
- attribute :path_payment_strict_send_op, PathPaymentStrictSendOp
76
+ attribute :create_account_op, CreateAccountOp
77
+ attribute :payment_op, PaymentOp
78
+ attribute :path_payment_strict_receive_op, PathPaymentStrictReceiveOp
79
+ attribute :manage_sell_offer_op, ManageSellOfferOp
80
+ attribute :create_passive_sell_offer_op, CreatePassiveSellOfferOp
81
+ attribute :set_options_op, SetOptionsOp
82
+ attribute :change_trust_op, ChangeTrustOp
83
+ attribute :allow_trust_op, AllowTrustOp
84
+ attribute :destination, MuxedAccount
85
+ attribute :manage_data_op, ManageDataOp
86
+ attribute :bump_sequence_op, BumpSequenceOp
87
+ attribute :manage_buy_offer_op, ManageBuyOfferOp
88
+ attribute :path_payment_strict_send_op, PathPaymentStrictSendOp
89
+ attribute :create_claimable_balance_op, CreateClaimableBalanceOp
90
+ attribute :claim_claimable_balance_op, ClaimClaimableBalanceOp
91
+ attribute :begin_sponsoring_future_reserves_op, BeginSponsoringFutureReservesOp
92
+ attribute :revoke_sponsorship_op, RevokeSponsorshipOp
74
93
  end
75
94
  end
76
95
  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
+ # union OperationID switch (EnvelopeType type)
9
+ # {
10
+ # case ENVELOPE_TYPE_OP_ID:
11
+ # struct
12
+ # {
13
+ # MuxedAccount sourceAccount;
14
+ # SequenceNumber seqNum;
15
+ # uint32 opNum;
16
+ # } id;
17
+ # };
18
+ #
19
+ # ===========================================================================
20
+ 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
31
+ end
32
+ 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
9
+ # {
10
+ # MuxedAccount sourceAccount;
11
+ # SequenceNumber seqNum;
12
+ # uint32 opNum;
13
+ # }
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class OperationID
18
+ class Id < XDR::Struct
19
+ attribute :source_account, MuxedAccount
20
+ attribute :seq_num, SequenceNumber
21
+ attribute :op_num, Uint32
22
+ end
23
+ end
24
+ end