stellar-base 0.19.0 → 0.23.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/{LICENSE.txt → LICENSE} +0 -0
  3. data/README.md +2 -3
  4. data/generated/stellar-base-generated.rb +45 -8
  5. data/generated/stellar/allow_trust_op.rb +5 -4
  6. data/generated/stellar/allow_trust_op/asset.rb +4 -4
  7. data/generated/stellar/asset.rb +2 -2
  8. data/generated/stellar/asset/alpha_num12.rb +2 -2
  9. data/generated/stellar/asset/alpha_num4.rb +2 -2
  10. data/generated/stellar/authenticated_message.rb +4 -4
  11. data/generated/stellar/authenticated_message/v0.rb +4 -4
  12. data/generated/stellar/bucket_entry.rb +6 -0
  13. data/generated/stellar/bucket_entry_type.rb +8 -2
  14. data/generated/stellar/bucket_metadata.rb +32 -0
  15. data/generated/stellar/bucket_metadata/ext.rb +24 -0
  16. data/generated/stellar/claim_offer_atom.rb +2 -2
  17. data/generated/stellar/{create_passive_offer_op.rb → create_passive_sell_offer_op.rb} +2 -2
  18. data/generated/stellar/crypto_key_type.rb +8 -4
  19. data/generated/stellar/curve25519_public.rb +1 -1
  20. data/generated/stellar/curve25519_secret.rb +1 -1
  21. data/generated/stellar/envelope_type.rb +10 -4
  22. data/generated/stellar/fee_bump_transaction.rb +39 -0
  23. data/generated/stellar/fee_bump_transaction/ext.rb +24 -0
  24. data/generated/stellar/fee_bump_transaction/inner_tx.rb +25 -0
  25. data/generated/stellar/fee_bump_transaction_envelope.rb +22 -0
  26. data/generated/stellar/hmac_sha256_key.rb +1 -1
  27. data/generated/stellar/hmac_sha256_mac.rb +1 -1
  28. data/generated/stellar/inner_transaction_result.rb +56 -0
  29. data/generated/stellar/inner_transaction_result/ext.rb +24 -0
  30. data/generated/stellar/inner_transaction_result/result.rb +52 -0
  31. data/generated/stellar/inner_transaction_result_pair.rb +20 -0
  32. data/generated/stellar/ledger_close_meta.rb +23 -0
  33. data/generated/stellar/ledger_close_meta_v0.rb +35 -0
  34. data/generated/stellar/ledger_close_value_signature.rb +20 -0
  35. data/generated/stellar/ledger_key.rb +1 -1
  36. data/generated/stellar/ledger_key/offer.rb +2 -2
  37. data/generated/stellar/manage_buy_offer_op.rb +29 -0
  38. data/generated/stellar/{manage_offer_result.rb → manage_buy_offer_result.rb} +5 -5
  39. data/generated/stellar/manage_buy_offer_result_code.rb +51 -0
  40. data/generated/stellar/{manage_offer_op.rb → manage_sell_offer_op.rb} +4 -4
  41. data/generated/stellar/manage_sell_offer_result.rb +26 -0
  42. data/generated/stellar/manage_sell_offer_result_code.rb +54 -0
  43. data/generated/stellar/message_type.rb +6 -1
  44. data/generated/stellar/muxed_account.rb +35 -0
  45. data/generated/stellar/muxed_account/med25519.rb +22 -0
  46. data/generated/stellar/offer_entry.rb +2 -2
  47. data/generated/stellar/operation.rb +13 -9
  48. data/generated/stellar/operation/body.rb +37 -29
  49. data/generated/stellar/operation_result.rb +10 -6
  50. data/generated/stellar/operation_result/tr.rb +38 -30
  51. data/generated/stellar/operation_result_code.rb +11 -7
  52. data/generated/stellar/operation_type.rb +20 -16
  53. data/generated/stellar/{path_payment_op.rb → path_payment_strict_receive_op.rb} +6 -6
  54. data/generated/stellar/path_payment_strict_receive_result.rb +38 -0
  55. data/generated/stellar/path_payment_strict_receive_result/success.rb +22 -0
  56. data/generated/stellar/path_payment_strict_receive_result_code.rb +56 -0
  57. data/generated/stellar/path_payment_strict_send_op.rb +32 -0
  58. data/generated/stellar/{path_payment_result.rb → path_payment_strict_send_result.rb} +7 -7
  59. data/generated/stellar/{path_payment_result → path_payment_strict_send_result}/success.rb +1 -1
  60. data/generated/stellar/path_payment_strict_send_result_code.rb +55 -0
  61. data/generated/stellar/payment_op.rb +4 -4
  62. data/generated/stellar/peer_stats.rb +48 -0
  63. data/generated/stellar/signed_survey_request_message.rb +20 -0
  64. data/generated/stellar/signed_survey_response_message.rb +20 -0
  65. data/generated/stellar/signer.rb +1 -1
  66. data/generated/stellar/stellar_message.rb +22 -12
  67. data/generated/stellar/stellar_value.rb +7 -5
  68. data/generated/stellar/stellar_value/ext.rb +8 -4
  69. data/generated/stellar/stellar_value_type.rb +22 -0
  70. data/generated/stellar/survey_message_command_type.rb +20 -0
  71. data/generated/stellar/survey_request_message.rb +26 -0
  72. data/generated/stellar/survey_response_body.rb +23 -0
  73. data/generated/stellar/survey_response_message.rb +26 -0
  74. data/generated/stellar/time_bounds.rb +4 -4
  75. data/generated/stellar/topology_response_body.rb +25 -0
  76. data/generated/stellar/transaction.rb +4 -4
  77. data/generated/stellar/transaction_envelope.rb +17 -8
  78. data/generated/stellar/transaction_meta.rb +4 -0
  79. data/generated/stellar/transaction_meta_v1.rb +1 -1
  80. data/generated/stellar/transaction_meta_v2.rb +24 -0
  81. data/generated/stellar/transaction_result.rb +3 -0
  82. data/generated/stellar/transaction_result/result.rb +9 -3
  83. data/generated/stellar/transaction_result_code.rb +21 -14
  84. data/generated/stellar/transaction_result_meta.rb +22 -0
  85. data/generated/stellar/transaction_signature_payload.rb +3 -1
  86. data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +7 -3
  87. data/generated/stellar/transaction_v0.rb +39 -0
  88. data/generated/stellar/transaction_v0/ext.rb +24 -0
  89. data/generated/stellar/transaction_v0_envelope.rb +22 -0
  90. data/generated/stellar/transaction_v1_envelope.rb +22 -0
  91. data/generated/stellar/trust_line_flags.rb +6 -2
  92. data/generated/stellar/upgrade_entry_meta.rb +20 -0
  93. data/lib/stellar-base.rb +28 -23
  94. data/lib/stellar/account_flags.rb +2 -4
  95. data/lib/stellar/asset.rb +6 -6
  96. data/lib/stellar/base.rb +1 -1
  97. data/lib/stellar/compat.rb +21 -0
  98. data/lib/stellar/concerns/transaction.rb +49 -0
  99. data/lib/stellar/convert.rb +2 -2
  100. data/lib/stellar/factories.rb +1 -3
  101. data/lib/stellar/fee_bump_transaction.rb +21 -0
  102. data/lib/stellar/key_pair.rb +9 -6
  103. data/lib/stellar/networks.rb +5 -7
  104. data/lib/stellar/operation.rb +428 -317
  105. data/lib/stellar/{path_payment_result.rb → path_payment_strict_receive_result.rb} +2 -3
  106. data/lib/stellar/price.rb +2 -4
  107. data/lib/stellar/signer_key.rb +4 -8
  108. data/lib/stellar/thresholds.rb +5 -7
  109. data/lib/stellar/transaction.rb +154 -169
  110. data/lib/stellar/transaction_builder.rb +149 -0
  111. data/lib/stellar/transaction_envelope.rb +40 -8
  112. data/lib/stellar/transaction_v0.rb +39 -0
  113. data/lib/stellar/util/continued_fraction.rb +19 -19
  114. data/lib/stellar/util/strkey.rb +39 -14
  115. data/lib/stellar/{base/version.rb → version.rb} +1 -1
  116. metadata +68 -210
  117. data/.gitignore +0 -17
  118. data/.travis.yml +0 -13
  119. data/.yardopts +0 -8
  120. data/CHANGELOG.md +0 -120
  121. data/CONTRIBUTING.md +0 -48
  122. data/Gemfile +0 -15
  123. data/Guardfile +0 -5
  124. data/Rakefile +0 -4
  125. data/examples/create_account.rb +0 -26
  126. data/examples/low_level_transaction_post.rb +0 -46
  127. data/examples/mid_level_transaction_post.rb +0 -33
  128. data/examples/non_native_payment.rb +0 -60
  129. data/examples/offer.rb +0 -75
  130. data/examples/transaction_merge.rb +0 -23
  131. data/generated/stellar/manage_offer_result_code.rb +0 -50
  132. data/generated/stellar/path_payment_result_code.rb +0 -47
  133. data/ruby-stellar-base.gemspec +0 -34
  134. data/spec/lib/stellar/account_flags_spec.rb +0 -19
  135. data/spec/lib/stellar/asset_spec.rb +0 -45
  136. data/spec/lib/stellar/convert_spec.rb +0 -61
  137. data/spec/lib/stellar/key_pair_spec.rb +0 -251
  138. data/spec/lib/stellar/networks_spec.rb +0 -77
  139. data/spec/lib/stellar/operation_spec.rb +0 -71
  140. data/spec/lib/stellar/path_payment_result_spec.rb +0 -95
  141. data/spec/lib/stellar/price_spec.rb +0 -34
  142. data/spec/lib/stellar/signer_key_spec.rb +0 -26
  143. data/spec/lib/stellar/thresholds_spec.rb +0 -62
  144. data/spec/lib/stellar/transaction_envelope_spec.rb +0 -93
  145. data/spec/lib/stellar/transaction_spec.rb +0 -100
  146. data/spec/lib/stellar/util/strkey_spec.rb +0 -54
  147. data/spec/spec_helper.rb +0 -16
  148. data/spec/support/matchers/be_strkey.rb +0 -9
  149. data/spec/support/matchers/eq_bytes.rb +0 -5
  150. data/spec/support/matchers/have_length.rb +0 -5
  151. data/tasks/rspec.rake +0 -6
  152. data/tasks/travis.rake +0 -1
  153. data/tasks/xdr.rake +0 -50
  154. data/xdr/Stellar-SCP.x +0 -86
  155. data/xdr/Stellar-ledger-entries.x +0 -288
  156. data/xdr/Stellar-ledger.x +0 -283
  157. data/xdr/Stellar-overlay.x +0 -146
  158. data/xdr/Stellar-transaction.x +0 -777
  159. data/xdr/Stellar-types.x +0 -81
@@ -14,12 +14,12 @@ require 'xdr'
14
14
  # CreateAccountResult createAccountResult;
15
15
  # case PAYMENT:
16
16
  # PaymentResult paymentResult;
17
- # case PATH_PAYMENT:
18
- # PathPaymentResult pathPaymentResult;
19
- # case MANAGE_OFFER:
20
- # ManageOfferResult manageOfferResult;
21
- # case CREATE_PASSIVE_OFFER:
22
- # ManageOfferResult createPassiveOfferResult;
17
+ # case PATH_PAYMENT_STRICT_RECEIVE:
18
+ # PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
19
+ # case MANAGE_SELL_OFFER:
20
+ # ManageSellOfferResult manageSellOfferResult;
21
+ # case CREATE_PASSIVE_SELL_OFFER:
22
+ # ManageSellOfferResult createPassiveSellOfferResult;
23
23
  # case SET_OPTIONS:
24
24
  # SetOptionsResult setOptionsResult;
25
25
  # case CHANGE_TRUST:
@@ -34,6 +34,10 @@ require 'xdr'
34
34
  # ManageDataResult manageDataResult;
35
35
  # case BUMP_SEQUENCE:
36
36
  # BumpSequenceResult bumpSeqResult;
37
+ # case MANAGE_BUY_OFFER:
38
+ # ManageBuyOfferResult manageBuyOfferResult;
39
+ # case PATH_PAYMENT_STRICT_SEND:
40
+ # PathPaymentStrictSendResult pathPaymentStrictSendResult;
37
41
  # }
38
42
  # tr;
39
43
  # default:
@@ -11,12 +11,12 @@ require 'xdr'
11
11
  # CreateAccountResult createAccountResult;
12
12
  # case PAYMENT:
13
13
  # PaymentResult paymentResult;
14
- # case PATH_PAYMENT:
15
- # PathPaymentResult pathPaymentResult;
16
- # case MANAGE_OFFER:
17
- # ManageOfferResult manageOfferResult;
18
- # case CREATE_PASSIVE_OFFER:
19
- # ManageOfferResult createPassiveOfferResult;
14
+ # case PATH_PAYMENT_STRICT_RECEIVE:
15
+ # PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
16
+ # case MANAGE_SELL_OFFER:
17
+ # ManageSellOfferResult manageSellOfferResult;
18
+ # case CREATE_PASSIVE_SELL_OFFER:
19
+ # ManageSellOfferResult createPassiveSellOfferResult;
20
20
  # case SET_OPTIONS:
21
21
  # SetOptionsResult setOptionsResult;
22
22
  # case CHANGE_TRUST:
@@ -31,6 +31,10 @@ require 'xdr'
31
31
  # ManageDataResult manageDataResult;
32
32
  # case BUMP_SEQUENCE:
33
33
  # BumpSequenceResult bumpSeqResult;
34
+ # case MANAGE_BUY_OFFER:
35
+ # ManageBuyOfferResult manageBuyOfferResult;
36
+ # case PATH_PAYMENT_STRICT_SEND:
37
+ # PathPaymentStrictSendResult pathPaymentStrictSendResult;
34
38
  # }
35
39
  #
36
40
  # ===========================================================================
@@ -39,31 +43,35 @@ module Stellar
39
43
  class Tr < XDR::Union
40
44
  switch_on OperationType, :type
41
45
 
42
- switch :create_account, :create_account_result
43
- switch :payment, :payment_result
44
- switch :path_payment, :path_payment_result
45
- switch :manage_offer, :manage_offer_result
46
- switch :create_passive_offer, :create_passive_offer_result
47
- switch :set_options, :set_options_result
48
- switch :change_trust, :change_trust_result
49
- switch :allow_trust, :allow_trust_result
50
- switch :account_merge, :account_merge_result
51
- switch :inflation, :inflation_result
52
- switch :manage_data, :manage_data_result
53
- switch :bump_sequence, :bump_seq_result
46
+ switch :create_account, :create_account_result
47
+ switch :payment, :payment_result
48
+ switch :path_payment_strict_receive, :path_payment_strict_receive_result
49
+ switch :manage_sell_offer, :manage_sell_offer_result
50
+ switch :create_passive_sell_offer, :create_passive_sell_offer_result
51
+ switch :set_options, :set_options_result
52
+ switch :change_trust, :change_trust_result
53
+ switch :allow_trust, :allow_trust_result
54
+ switch :account_merge, :account_merge_result
55
+ switch :inflation, :inflation_result
56
+ switch :manage_data, :manage_data_result
57
+ switch :bump_sequence, :bump_seq_result
58
+ switch :manage_buy_offer, :manage_buy_offer_result
59
+ switch :path_payment_strict_send, :path_payment_strict_send_result
54
60
 
55
- attribute :create_account_result, CreateAccountResult
56
- attribute :payment_result, PaymentResult
57
- attribute :path_payment_result, PathPaymentResult
58
- attribute :manage_offer_result, ManageOfferResult
59
- attribute :create_passive_offer_result, ManageOfferResult
60
- attribute :set_options_result, SetOptionsResult
61
- attribute :change_trust_result, ChangeTrustResult
62
- attribute :allow_trust_result, AllowTrustResult
63
- attribute :account_merge_result, AccountMergeResult
64
- attribute :inflation_result, InflationResult
65
- attribute :manage_data_result, ManageDataResult
66
- attribute :bump_seq_result, BumpSequenceResult
61
+ attribute :create_account_result, CreateAccountResult
62
+ attribute :payment_result, PaymentResult
63
+ attribute :path_payment_strict_receive_result, PathPaymentStrictReceiveResult
64
+ attribute :manage_sell_offer_result, ManageSellOfferResult
65
+ attribute :create_passive_sell_offer_result, ManageSellOfferResult
66
+ attribute :set_options_result, SetOptionsResult
67
+ attribute :change_trust_result, ChangeTrustResult
68
+ attribute :allow_trust_result, AllowTrustResult
69
+ attribute :account_merge_result, AccountMergeResult
70
+ attribute :inflation_result, InflationResult
71
+ attribute :manage_data_result, ManageDataResult
72
+ attribute :bump_seq_result, BumpSequenceResult
73
+ attribute :manage_buy_offer_result, ManageBuyOfferResult
74
+ attribute :path_payment_strict_send_result, PathPaymentStrictSendResult
67
75
  end
68
76
  end
69
77
  end
@@ -9,18 +9,22 @@ require 'xdr'
9
9
  # {
10
10
  # opINNER = 0, // inner object result is valid
11
11
  #
12
- # opBAD_AUTH = -1, // too few valid signatures / wrong network
13
- # opNO_ACCOUNT = -2, // source account was not found
14
- # opNOT_SUPPORTED = -3 // operation not supported at this time
12
+ # opBAD_AUTH = -1, // too few valid signatures / wrong network
13
+ # opNO_ACCOUNT = -2, // source account was not found
14
+ # opNOT_SUPPORTED = -3, // operation not supported at this time
15
+ # opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached
16
+ # opEXCEEDED_WORK_LIMIT = -5 // operation did too much work
15
17
  # };
16
18
  #
17
19
  # ===========================================================================
18
20
  module Stellar
19
21
  class OperationResultCode < XDR::Enum
20
- member :op_inner, 0
21
- member :op_bad_auth, -1
22
- member :op_no_account, -2
23
- member :op_not_supported, -3
22
+ member :op_inner, 0
23
+ member :op_bad_auth, -1
24
+ member :op_no_account, -2
25
+ member :op_not_supported, -3
26
+ member :op_too_many_subentries, -4
27
+ member :op_exceeded_work_limit, -5
24
28
 
25
29
  seal
26
30
  end
@@ -9,33 +9,37 @@ require 'xdr'
9
9
  # {
10
10
  # CREATE_ACCOUNT = 0,
11
11
  # PAYMENT = 1,
12
- # PATH_PAYMENT = 2,
13
- # MANAGE_OFFER = 3,
14
- # CREATE_PASSIVE_OFFER = 4,
12
+ # PATH_PAYMENT_STRICT_RECEIVE = 2,
13
+ # MANAGE_SELL_OFFER = 3,
14
+ # CREATE_PASSIVE_SELL_OFFER = 4,
15
15
  # SET_OPTIONS = 5,
16
16
  # CHANGE_TRUST = 6,
17
17
  # ALLOW_TRUST = 7,
18
18
  # ACCOUNT_MERGE = 8,
19
19
  # INFLATION = 9,
20
20
  # MANAGE_DATA = 10,
21
- # BUMP_SEQUENCE = 11
21
+ # BUMP_SEQUENCE = 11,
22
+ # MANAGE_BUY_OFFER = 12,
23
+ # PATH_PAYMENT_STRICT_SEND = 13
22
24
  # };
23
25
  #
24
26
  # ===========================================================================
25
27
  module Stellar
26
28
  class OperationType < XDR::Enum
27
- member :create_account, 0
28
- member :payment, 1
29
- member :path_payment, 2
30
- member :manage_offer, 3
31
- member :create_passive_offer, 4
32
- member :set_options, 5
33
- member :change_trust, 6
34
- member :allow_trust, 7
35
- member :account_merge, 8
36
- member :inflation, 9
37
- member :manage_data, 10
38
- member :bump_sequence, 11
29
+ member :create_account, 0
30
+ member :payment, 1
31
+ member :path_payment_strict_receive, 2
32
+ member :manage_sell_offer, 3
33
+ member :create_passive_sell_offer, 4
34
+ member :set_options, 5
35
+ member :change_trust, 6
36
+ member :allow_trust, 7
37
+ member :account_merge, 8
38
+ member :inflation, 9
39
+ member :manage_data, 10
40
+ member :bump_sequence, 11
41
+ member :manage_buy_offer, 12
42
+ member :path_payment_strict_send, 13
39
43
 
40
44
  seal
41
45
  end
@@ -5,26 +5,26 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # struct PathPaymentOp
8
+ # struct PathPaymentStrictReceiveOp
9
9
  # {
10
10
  # Asset sendAsset; // asset we pay with
11
11
  # int64 sendMax; // the maximum amount of sendAsset to
12
12
  # // send (excluding fees).
13
13
  # // The operation will fail if can't be met
14
14
  #
15
- # AccountID destination; // recipient of the payment
16
- # Asset destAsset; // what they end up with
17
- # int64 destAmount; // amount they end up with
15
+ # MuxedAccount destination; // recipient of the payment
16
+ # Asset destAsset; // what they end up with
17
+ # int64 destAmount; // amount they end up with
18
18
  #
19
19
  # Asset path<5>; // additional hops it must go through to get there
20
20
  # };
21
21
  #
22
22
  # ===========================================================================
23
23
  module Stellar
24
- class PathPaymentOp < XDR::Struct
24
+ class PathPaymentStrictReceiveOp < XDR::Struct
25
25
  attribute :send_asset, Asset
26
26
  attribute :send_max, Int64
27
- attribute :destination, AccountID
27
+ attribute :destination, MuxedAccount
28
28
  attribute :dest_asset, Asset
29
29
  attribute :dest_amount, Int64
30
30
  attribute :path, XDR::VarArray[Asset, 5]
@@ -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 PathPaymentStrictReceiveResult switch (PathPaymentStrictReceiveResultCode code)
9
+ # {
10
+ # case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS:
11
+ # struct
12
+ # {
13
+ # ClaimOfferAtom offers<>;
14
+ # SimplePaymentResult last;
15
+ # } success;
16
+ # case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
17
+ # Asset noIssuer; // the asset that caused the error
18
+ # default:
19
+ # void;
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class PathPaymentStrictReceiveResult < XDR::Union
25
+ include XDR::Namespace
26
+
27
+ autoload :Success
28
+
29
+ switch_on PathPaymentStrictReceiveResultCode, :code
30
+
31
+ switch :path_payment_strict_receive_success, :success
32
+ switch :path_payment_strict_receive_no_issuer, :no_issuer
33
+ switch :default
34
+
35
+ attribute :success, Success
36
+ attribute :no_issuer, Asset
37
+ end
38
+ 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
9
+ # {
10
+ # ClaimOfferAtom offers<>;
11
+ # SimplePaymentResult last;
12
+ # }
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class PathPaymentStrictReceiveResult
17
+ class Success < XDR::Struct
18
+ attribute :offers, XDR::VarArray[ClaimOfferAtom]
19
+ attribute :last, SimplePaymentResult
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,56 @@
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 PathPaymentStrictReceiveResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input
15
+ # PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED =
16
+ # -2, // not enough funds in source account
17
+ # PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST =
18
+ # -3, // no trust line on source account
19
+ # PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED =
20
+ # -4, // source not authorized to transfer
21
+ # PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION =
22
+ # -5, // destination account does not exist
23
+ # PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST =
24
+ # -6, // dest missing a trust line for asset
25
+ # PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED =
26
+ # -7, // dest not authorized to hold asset
27
+ # PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL =
28
+ # -8, // dest would go above their limit
29
+ # PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset
30
+ # PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS =
31
+ # -10, // not enough offers to satisfy path
32
+ # PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF =
33
+ # -11, // would cross one of its own offers
34
+ # PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax
35
+ # };
36
+ #
37
+ # ===========================================================================
38
+ module Stellar
39
+ class PathPaymentStrictReceiveResultCode < XDR::Enum
40
+ member :path_payment_strict_receive_success, 0
41
+ member :path_payment_strict_receive_malformed, -1
42
+ member :path_payment_strict_receive_underfunded, -2
43
+ member :path_payment_strict_receive_src_no_trust, -3
44
+ member :path_payment_strict_receive_src_not_authorized, -4
45
+ member :path_payment_strict_receive_no_destination, -5
46
+ member :path_payment_strict_receive_no_trust, -6
47
+ member :path_payment_strict_receive_not_authorized, -7
48
+ member :path_payment_strict_receive_line_full, -8
49
+ member :path_payment_strict_receive_no_issuer, -9
50
+ member :path_payment_strict_receive_too_few_offers, -10
51
+ member :path_payment_strict_receive_offer_cross_self, -11
52
+ member :path_payment_strict_receive_over_sendmax, -12
53
+
54
+ seal
55
+ end
56
+ 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 PathPaymentStrictSendOp
9
+ # {
10
+ # Asset sendAsset; // asset we pay with
11
+ # int64 sendAmount; // amount of sendAsset to send (excluding fees)
12
+ #
13
+ # MuxedAccount destination; // recipient of the payment
14
+ # Asset destAsset; // what they end up with
15
+ # int64 destMin; // the minimum amount of dest asset to
16
+ # // be received
17
+ # // The operation will fail if it can't be met
18
+ #
19
+ # Asset path<5>; // additional hops it must go through to get there
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class PathPaymentStrictSendOp < XDR::Struct
25
+ attribute :send_asset, Asset
26
+ attribute :send_amount, Int64
27
+ attribute :destination, MuxedAccount
28
+ attribute :dest_asset, Asset
29
+ attribute :dest_min, Int64
30
+ attribute :path, XDR::VarArray[Asset, 5]
31
+ end
32
+ end
@@ -5,15 +5,15 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # union PathPaymentResult switch (PathPaymentResultCode code)
8
+ # union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code)
9
9
  # {
10
- # case PATH_PAYMENT_SUCCESS:
10
+ # case PATH_PAYMENT_STRICT_SEND_SUCCESS:
11
11
  # struct
12
12
  # {
13
13
  # ClaimOfferAtom offers<>;
14
14
  # SimplePaymentResult last;
15
15
  # } success;
16
- # case PATH_PAYMENT_NO_ISSUER:
16
+ # case PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
17
17
  # Asset noIssuer; // the asset that caused the error
18
18
  # default:
19
19
  # void;
@@ -21,15 +21,15 @@ require 'xdr'
21
21
  #
22
22
  # ===========================================================================
23
23
  module Stellar
24
- class PathPaymentResult < XDR::Union
24
+ class PathPaymentStrictSendResult < XDR::Union
25
25
  include XDR::Namespace
26
26
 
27
27
  autoload :Success
28
28
 
29
- switch_on PathPaymentResultCode, :code
29
+ switch_on PathPaymentStrictSendResultCode, :code
30
30
 
31
- switch :path_payment_success, :success
32
- switch :path_payment_no_issuer, :no_issuer
31
+ switch :path_payment_strict_send_success, :success
32
+ switch :path_payment_strict_send_no_issuer, :no_issuer
33
33
  switch :default
34
34
 
35
35
  attribute :success, Success
@@ -13,7 +13,7 @@ require 'xdr'
13
13
  #
14
14
  # ===========================================================================
15
15
  module Stellar
16
- class PathPaymentResult
16
+ class PathPaymentStrictSendResult
17
17
  class Success < XDR::Struct
18
18
  attribute :offers, XDR::VarArray[ClaimOfferAtom]
19
19
  attribute :last, SimplePaymentResult
@@ -0,0 +1,55 @@
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 PathPaymentStrictSendResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input
15
+ # PATH_PAYMENT_STRICT_SEND_UNDERFUNDED =
16
+ # -2, // not enough funds in source account
17
+ # PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST =
18
+ # -3, // no trust line on source account
19
+ # PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED =
20
+ # -4, // source not authorized to transfer
21
+ # PATH_PAYMENT_STRICT_SEND_NO_DESTINATION =
22
+ # -5, // destination account does not exist
23
+ # PATH_PAYMENT_STRICT_SEND_NO_TRUST =
24
+ # -6, // dest missing a trust line for asset
25
+ # PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED =
26
+ # -7, // dest not authorized to hold asset
27
+ # PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit
28
+ # PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset
29
+ # PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS =
30
+ # -10, // not enough offers to satisfy path
31
+ # PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF =
32
+ # -11, // would cross one of its own offers
33
+ # PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin
34
+ # };
35
+ #
36
+ # ===========================================================================
37
+ module Stellar
38
+ class PathPaymentStrictSendResultCode < XDR::Enum
39
+ member :path_payment_strict_send_success, 0
40
+ member :path_payment_strict_send_malformed, -1
41
+ member :path_payment_strict_send_underfunded, -2
42
+ member :path_payment_strict_send_src_no_trust, -3
43
+ member :path_payment_strict_send_src_not_authorized, -4
44
+ member :path_payment_strict_send_no_destination, -5
45
+ member :path_payment_strict_send_no_trust, -6
46
+ member :path_payment_strict_send_not_authorized, -7
47
+ member :path_payment_strict_send_line_full, -8
48
+ member :path_payment_strict_send_no_issuer, -9
49
+ member :path_payment_strict_send_too_few_offers, -10
50
+ member :path_payment_strict_send_offer_cross_self, -11
51
+ member :path_payment_strict_send_under_destmin, -12
52
+
53
+ seal
54
+ end
55
+ end