open-core 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +15 -0
  4. data/.yardopts +8 -0
  5. data/CONTRIBUTING.md +48 -0
  6. data/Gemfile +15 -0
  7. data/Guardfile +5 -0
  8. data/LICENSE.txt +202 -0
  9. data/README.md +83 -0
  10. data/Rakefile +4 -0
  11. data/examples/create_account.rb +26 -0
  12. data/examples/low_level_transaction_post.rb +46 -0
  13. data/examples/mid_level_transaction_post.rb +33 -0
  14. data/examples/non_native_payment.rb +60 -0
  15. data/examples/offer.rb +75 -0
  16. data/examples/transaction_merge.rb +23 -0
  17. data/generated/stellar-base-generated.rb +134 -0
  18. data/generated/stellar/account_entry.rb +53 -0
  19. data/generated/stellar/account_entry/ext.rb +24 -0
  20. data/generated/stellar/account_flags.rb +27 -0
  21. data/generated/stellar/account_merge_result.rb +26 -0
  22. data/generated/stellar/account_merge_result_code.rb +30 -0
  23. data/generated/stellar/allow_trust_op.rb +38 -0
  24. data/generated/stellar/allow_trust_op/asset.rb +33 -0
  25. data/generated/stellar/allow_trust_result.rb +25 -0
  26. data/generated/stellar/allow_trust_result_code.rb +31 -0
  27. data/generated/stellar/asset.rb +47 -0
  28. data/generated/stellar/asset/alpha_num12.rb +22 -0
  29. data/generated/stellar/asset/alpha_num4.rb +22 -0
  30. data/generated/stellar/asset_type.rb +24 -0
  31. data/generated/stellar/bucket_entry.rb +28 -0
  32. data/generated/stellar/bucket_entry_type.rb +22 -0
  33. data/generated/stellar/change_trust_op.rb +22 -0
  34. data/generated/stellar/change_trust_result.rb +25 -0
  35. data/generated/stellar/change_trust_result_code.rb +30 -0
  36. data/generated/stellar/claim_offer_atom.rb +33 -0
  37. data/generated/stellar/create_account_op.rb +20 -0
  38. data/generated/stellar/create_account_result.rb +25 -0
  39. data/generated/stellar/create_account_result_code.rb +32 -0
  40. data/generated/stellar/create_passive_offer_op.rb +24 -0
  41. data/generated/stellar/crypto_key_type.rb +20 -0
  42. data/generated/stellar/decorated_signature.rb +20 -0
  43. data/generated/stellar/dont_have.rb +20 -0
  44. data/generated/stellar/envelope_type.rb +22 -0
  45. data/generated/stellar/error.rb +20 -0
  46. data/generated/stellar/hello.rb +26 -0
  47. data/generated/stellar/inflation_payout.rb +20 -0
  48. data/generated/stellar/inflation_result.rb +26 -0
  49. data/generated/stellar/inflation_result_code.rb +24 -0
  50. data/generated/stellar/ledger_entry.rb +44 -0
  51. data/generated/stellar/ledger_entry/data.rb +33 -0
  52. data/generated/stellar/ledger_entry/ext.rb +24 -0
  53. data/generated/stellar/ledger_entry_change.rb +31 -0
  54. data/generated/stellar/ledger_entry_change_type.rb +24 -0
  55. data/generated/stellar/ledger_entry_type.rb +24 -0
  56. data/generated/stellar/ledger_header.rb +65 -0
  57. data/generated/stellar/ledger_header/ext.rb +24 -0
  58. data/generated/stellar/ledger_header_history_entry.rb +33 -0
  59. data/generated/stellar/ledger_header_history_entry/ext.rb +24 -0
  60. data/generated/stellar/ledger_key.rb +50 -0
  61. data/generated/stellar/ledger_key/account.rb +20 -0
  62. data/generated/stellar/ledger_key/offer.rb +22 -0
  63. data/generated/stellar/ledger_key/trust_line.rb +22 -0
  64. data/generated/stellar/ledger_upgrade.rb +27 -0
  65. data/generated/stellar/ledger_upgrade_type.rb +22 -0
  66. data/generated/stellar/manage_offer_effect.rb +24 -0
  67. data/generated/stellar/manage_offer_op.rb +28 -0
  68. data/generated/stellar/manage_offer_result.rb +26 -0
  69. data/generated/stellar/manage_offer_result_code.rb +48 -0
  70. data/generated/stellar/manage_offer_success_result.rb +34 -0
  71. data/generated/stellar/manage_offer_success_result/offer.rb +30 -0
  72. data/generated/stellar/memo.rb +38 -0
  73. data/generated/stellar/memo_type.rb +28 -0
  74. data/generated/stellar/message_type.rb +45 -0
  75. data/generated/stellar/offer_entry.rb +49 -0
  76. data/generated/stellar/offer_entry/ext.rb +24 -0
  77. data/generated/stellar/offer_entry_flags.rb +21 -0
  78. data/generated/stellar/operation.rb +51 -0
  79. data/generated/stellar/operation/body.rb +60 -0
  80. data/generated/stellar/operation_meta.rb +18 -0
  81. data/generated/stellar/operation_result.rb +53 -0
  82. data/generated/stellar/operation_result/tr.rb +61 -0
  83. data/generated/stellar/operation_result_code.rb +25 -0
  84. data/generated/stellar/operation_type.rb +38 -0
  85. data/generated/stellar/path_payment_op.rb +32 -0
  86. data/generated/stellar/path_payment_result.rb +34 -0
  87. data/generated/stellar/path_payment_result/success.rb +22 -0
  88. data/generated/stellar/path_payment_result_code.rb +45 -0
  89. data/generated/stellar/payment_op.rb +22 -0
  90. data/generated/stellar/payment_result.rb +25 -0
  91. data/generated/stellar/payment_result_code.rb +39 -0
  92. data/generated/stellar/peer_address.rb +22 -0
  93. data/generated/stellar/price.rb +20 -0
  94. data/generated/stellar/public_key.rb +23 -0
  95. data/generated/stellar/scp_ballot.rb +20 -0
  96. data/generated/stellar/scp_envelope.rb +20 -0
  97. data/generated/stellar/scp_nomination.rb +22 -0
  98. data/generated/stellar/scp_quorum_set.rb +22 -0
  99. data/generated/stellar/scp_statement.rb +59 -0
  100. data/generated/stellar/scp_statement/pledges.rb +64 -0
  101. data/generated/stellar/scp_statement/pledges/confirm.rb +28 -0
  102. data/generated/stellar/scp_statement/pledges/externalize.rb +28 -0
  103. data/generated/stellar/scp_statement/pledges/prepare.rb +32 -0
  104. data/generated/stellar/scp_statement_type.rb +26 -0
  105. data/generated/stellar/set_options_op.rb +41 -0
  106. data/generated/stellar/set_options_result.rb +25 -0
  107. data/generated/stellar/set_options_result_code.rb +38 -0
  108. data/generated/stellar/signer.rb +20 -0
  109. data/generated/stellar/simple_payment_result.rb +22 -0
  110. data/generated/stellar/stellar_message.rb +66 -0
  111. data/generated/stellar/stellar_value.rb +40 -0
  112. data/generated/stellar/stellar_value/ext.rb +24 -0
  113. data/generated/stellar/threshold_indexes.rb +26 -0
  114. data/generated/stellar/time_bounds.rb +20 -0
  115. data/generated/stellar/transaction.rb +50 -0
  116. data/generated/stellar/transaction/ext.rb +24 -0
  117. data/generated/stellar/transaction_envelope.rb +20 -0
  118. data/generated/stellar/transaction_history_entry.rb +33 -0
  119. data/generated/stellar/transaction_history_entry/ext.rb +24 -0
  120. data/generated/stellar/transaction_history_result_entry.rb +33 -0
  121. data/generated/stellar/transaction_history_result_entry/ext.rb +24 -0
  122. data/generated/stellar/transaction_meta.rb +31 -0
  123. data/generated/stellar/transaction_meta/v0.rb +22 -0
  124. data/generated/stellar/transaction_result.rb +43 -0
  125. data/generated/stellar/transaction_result/ext.rb +24 -0
  126. data/generated/stellar/transaction_result/result.rb +30 -0
  127. data/generated/stellar/transaction_result_code.rb +45 -0
  128. data/generated/stellar/transaction_result_pair.rb +20 -0
  129. data/generated/stellar/transaction_result_set.rb +18 -0
  130. data/generated/stellar/transaction_set.rb +20 -0
  131. data/generated/stellar/trust_line_entry.rb +41 -0
  132. data/generated/stellar/trust_line_entry/ext.rb +24 -0
  133. data/generated/stellar/trust_line_flags.rb +21 -0
  134. data/lib/stellar-base.rb +32 -0
  135. data/lib/stellar/account_flags.rb +28 -0
  136. data/lib/stellar/asset.rb +69 -0
  137. data/lib/stellar/base.rb +1 -0
  138. data/lib/stellar/base/version.rb +5 -0
  139. data/lib/stellar/convert.rb +32 -0
  140. data/lib/stellar/key_pair.rb +112 -0
  141. data/lib/stellar/networks.rb +45 -0
  142. data/lib/stellar/operation.rb +304 -0
  143. data/lib/stellar/path_payment_result.rb +17 -0
  144. data/lib/stellar/price.rb +32 -0
  145. data/lib/stellar/thresholds.rb +39 -0
  146. data/lib/stellar/transaction.rb +170 -0
  147. data/lib/stellar/transaction_envelope.rb +32 -0
  148. data/lib/stellar/util/continued_fraction.rb +96 -0
  149. data/lib/stellar/util/strkey.rb +43 -0
  150. data/open-core.gemspec +37 -0
  151. data/spec/lib/stellar/account_flags_spec.rb +19 -0
  152. data/spec/lib/stellar/asset_spec.rb +45 -0
  153. data/spec/lib/stellar/convert_spec.rb +61 -0
  154. data/spec/lib/stellar/key_pair_spec.rb +238 -0
  155. data/spec/lib/stellar/networks_spec.rb +77 -0
  156. data/spec/lib/stellar/path_payment_result_spec.rb +95 -0
  157. data/spec/lib/stellar/price_spec.rb +34 -0
  158. data/spec/lib/stellar/thresholds_spec.rb +62 -0
  159. data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
  160. data/spec/lib/stellar/transaction_spec.rb +54 -0
  161. data/spec/lib/stellar/util/strkey_spec.rb +46 -0
  162. data/spec/spec_helper.rb +16 -0
  163. data/spec/support/matchers/be_strkey.rb +9 -0
  164. data/spec/support/matchers/eq_bytes.rb +5 -0
  165. data/spec/support/matchers/have_length.rb +5 -0
  166. data/tasks/rspec.rake +6 -0
  167. data/tasks/travis.rake +1 -0
  168. data/tasks/xdr.rake +50 -0
  169. data/xdr/Stellar-SCP.x +87 -0
  170. data/xdr/Stellar-ledger-entries.x +222 -0
  171. data/xdr/Stellar-ledger.x +231 -0
  172. data/xdr/Stellar-overlay.x +87 -0
  173. data/xdr/Stellar-transaction.x +670 -0
  174. data/xdr/Stellar-types.x +34 -0
  175. metadata +444 -0
@@ -0,0 +1,53 @@
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 OperationResult switch (OperationResultCode code)
9
+ # {
10
+ # case opINNER:
11
+ # union switch (OperationType type)
12
+ # {
13
+ # case CREATE_ACCOUNT:
14
+ # CreateAccountResult createAccountResult;
15
+ # case PAYMENT:
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;
23
+ # case SET_OPTIONS:
24
+ # SetOptionsResult setOptionsResult;
25
+ # case CHANGE_TRUST:
26
+ # ChangeTrustResult changeTrustResult;
27
+ # case ALLOW_TRUST:
28
+ # AllowTrustResult allowTrustResult;
29
+ # case ACCOUNT_MERGE:
30
+ # AccountMergeResult accountMergeResult;
31
+ # case INFLATION:
32
+ # InflationResult inflationResult;
33
+ # }
34
+ # tr;
35
+ # default:
36
+ # void;
37
+ # };
38
+ #
39
+ # ===========================================================================
40
+ module Stellar
41
+ class OperationResult < XDR::Union
42
+ include XDR::Namespace
43
+
44
+ autoload :Tr
45
+
46
+ switch_on OperationResultCode, :code
47
+
48
+ switch :op_inner, :tr
49
+ switch :default
50
+
51
+ attribute :tr, Tr
52
+ end
53
+ end
@@ -0,0 +1,61 @@
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 (OperationType type)
9
+ # {
10
+ # case CREATE_ACCOUNT:
11
+ # CreateAccountResult createAccountResult;
12
+ # case PAYMENT:
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;
20
+ # case SET_OPTIONS:
21
+ # SetOptionsResult setOptionsResult;
22
+ # case CHANGE_TRUST:
23
+ # ChangeTrustResult changeTrustResult;
24
+ # case ALLOW_TRUST:
25
+ # AllowTrustResult allowTrustResult;
26
+ # case ACCOUNT_MERGE:
27
+ # AccountMergeResult accountMergeResult;
28
+ # case INFLATION:
29
+ # InflationResult inflationResult;
30
+ # }
31
+ #
32
+ # ===========================================================================
33
+ module Stellar
34
+ class OperationResult
35
+ class Tr < XDR::Union
36
+ switch_on OperationType, :type
37
+
38
+ switch :create_account, :create_account_result
39
+ switch :payment, :payment_result
40
+ switch :path_payment, :path_payment_result
41
+ switch :manage_offer, :manage_offer_result
42
+ switch :create_passive_offer, :create_passive_offer_result
43
+ switch :set_options, :set_options_result
44
+ switch :change_trust, :change_trust_result
45
+ switch :allow_trust, :allow_trust_result
46
+ switch :account_merge, :account_merge_result
47
+ switch :inflation, :inflation_result
48
+
49
+ attribute :create_account_result, CreateAccountResult
50
+ attribute :payment_result, PaymentResult
51
+ attribute :path_payment_result, PathPaymentResult
52
+ attribute :manage_offer_result, ManageOfferResult
53
+ attribute :create_passive_offer_result, ManageOfferResult
54
+ attribute :set_options_result, SetOptionsResult
55
+ attribute :change_trust_result, ChangeTrustResult
56
+ attribute :allow_trust_result, AllowTrustResult
57
+ attribute :account_merge_result, AccountMergeResult
58
+ attribute :inflation_result, InflationResult
59
+ end
60
+ end
61
+ 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
+ # enum OperationResultCode
9
+ # {
10
+ # opINNER = 0, // inner object result is valid
11
+ #
12
+ # opBAD_AUTH = -1, // not enough signatures to perform operation
13
+ # opNO_ACCOUNT = -2 // source account was not found
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class OperationResultCode < XDR::Enum
19
+ member :op_inner, 0
20
+ member :op_bad_auth, -1
21
+ member :op_no_account, -2
22
+
23
+ seal
24
+ end
25
+ 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
+ # enum OperationType
9
+ # {
10
+ # CREATE_ACCOUNT = 0,
11
+ # PAYMENT = 1,
12
+ # PATH_PAYMENT = 2,
13
+ # MANAGE_OFFER = 3,
14
+ # CREATE_PASSIVE_OFFER = 4,
15
+ # SET_OPTIONS = 5,
16
+ # CHANGE_TRUST = 6,
17
+ # ALLOW_TRUST = 7,
18
+ # ACCOUNT_MERGE = 8,
19
+ # INFLATION = 9
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class OperationType < XDR::Enum
25
+ member :create_account, 0
26
+ member :payment, 1
27
+ member :path_payment, 2
28
+ member :manage_offer, 3
29
+ member :create_passive_offer, 4
30
+ member :set_options, 5
31
+ member :change_trust, 6
32
+ member :allow_trust, 7
33
+ member :account_merge, 8
34
+ member :inflation, 9
35
+
36
+ seal
37
+ end
38
+ 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 PathPaymentOp
9
+ # {
10
+ # Asset sendAsset; // asset we pay with
11
+ # int64 sendMax; // the maximum amount of sendAsset to
12
+ # // send (excluding fees).
13
+ # // The operation will fail if can't be met
14
+ #
15
+ # AccountID destination; // recipient of the payment
16
+ # Asset destAsset; // what they end up with
17
+ # int64 destAmount; // amount they end up with
18
+ #
19
+ # Asset path<5>; // additional hops it must go through to get there
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class PathPaymentOp < XDR::Struct
25
+ attribute :send_asset, Asset
26
+ attribute :send_max, Int64
27
+ attribute :destination, AccountID
28
+ attribute :dest_asset, Asset
29
+ attribute :dest_amount, Int64
30
+ attribute :path, XDR::VarArray[Asset, 5]
31
+ end
32
+ end
@@ -0,0 +1,34 @@
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 PathPaymentResult switch (PathPaymentResultCode code)
9
+ # {
10
+ # case PATH_PAYMENT_SUCCESS:
11
+ # struct
12
+ # {
13
+ # ClaimOfferAtom offers<>;
14
+ # SimplePaymentResult last;
15
+ # } success;
16
+ # default:
17
+ # void;
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class PathPaymentResult < XDR::Union
23
+ include XDR::Namespace
24
+
25
+ autoload :Success
26
+
27
+ switch_on PathPaymentResultCode, :code
28
+
29
+ switch :path_payment_success, :success
30
+ switch :default
31
+
32
+ attribute :success, Success
33
+ end
34
+ 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 PathPaymentResult
17
+ class Success < XDR::Struct
18
+ attribute :offers, XDR::VarArray[ClaimOfferAtom]
19
+ attribute :last, SimplePaymentResult
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,45 @@
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 PathPaymentResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # PATH_PAYMENT_SUCCESS = 0, // success
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # PATH_PAYMENT_MALFORMED = -1, // bad input
15
+ # PATH_PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
16
+ # PATH_PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account
17
+ # PATH_PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
18
+ # PATH_PAYMENT_NO_DESTINATION = -5, // destination account does not exist
19
+ # PATH_PAYMENT_NO_TRUST = -6, // dest missing a trust line for asset
20
+ # PATH_PAYMENT_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
21
+ # PATH_PAYMENT_LINE_FULL = -8, // dest would go above their limit
22
+ # PATH_PAYMENT_TOO_FEW_OFFERS = -9, // not enough offers to satisfy path
23
+ # PATH_PAYMENT_OFFER_CROSS_SELF = -10, // would cross one of its own offers
24
+ # PATH_PAYMENT_OVER_SENDMAX = -11 // could not satisfy sendmax
25
+ # };
26
+ #
27
+ # ===========================================================================
28
+ module Stellar
29
+ class PathPaymentResultCode < XDR::Enum
30
+ member :path_payment_success, 0
31
+ member :path_payment_malformed, -1
32
+ member :path_payment_underfunded, -2
33
+ member :path_payment_src_no_trust, -3
34
+ member :path_payment_src_not_authorized, -4
35
+ member :path_payment_no_destination, -5
36
+ member :path_payment_no_trust, -6
37
+ member :path_payment_not_authorized, -7
38
+ member :path_payment_line_full, -8
39
+ member :path_payment_too_few_offers, -9
40
+ member :path_payment_offer_cross_self, -10
41
+ member :path_payment_over_sendmax, -11
42
+
43
+ seal
44
+ end
45
+ 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 PaymentOp
9
+ # {
10
+ # AccountID destination; // recipient of the payment
11
+ # Asset asset; // what they end up with
12
+ # int64 amount; // amount they end up with
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class PaymentOp < XDR::Struct
18
+ attribute :destination, AccountID
19
+ attribute :asset, Asset
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 PaymentResult switch (PaymentResultCode code)
9
+ # {
10
+ # case PAYMENT_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class PaymentResult < XDR::Union
19
+ switch_on PaymentResultCode, :code
20
+
21
+ switch :payment_success
22
+ switch :default
23
+
24
+ end
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
+ # enum PaymentResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # PAYMENT_SUCCESS = 0, // payment successfuly completed
12
+ #
13
+ # // codes considered as "failure" for the operation
14
+ # PAYMENT_MALFORMED = -1, // bad input
15
+ # PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
16
+ # PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account
17
+ # PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
18
+ # PAYMENT_NO_DESTINATION = -5, // destination account does not exist
19
+ # PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset
20
+ # PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset
21
+ # PAYMENT_LINE_FULL = -8 // destination would go above their limit
22
+ # };
23
+ #
24
+ # ===========================================================================
25
+ module Stellar
26
+ class PaymentResultCode < XDR::Enum
27
+ member :payment_success, 0
28
+ member :payment_malformed, -1
29
+ member :payment_underfunded, -2
30
+ member :payment_src_no_trust, -3
31
+ member :payment_src_not_authorized, -4
32
+ member :payment_no_destination, -5
33
+ member :payment_no_trust, -6
34
+ member :payment_not_authorized, -7
35
+ member :payment_line_full, -8
36
+
37
+ seal
38
+ end
39
+ 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 PeerAddress
9
+ # {
10
+ # opaque ip[4];
11
+ # uint32 port;
12
+ # uint32 numFailures;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class PeerAddress < XDR::Struct
18
+ attribute :ip, XDR::Opaque[4]
19
+ attribute :port, Uint32
20
+ attribute :num_failures, Uint32
21
+ end
22
+ 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 Price
9
+ # {
10
+ # int32 n; // numerator
11
+ # int32 d; // denominator
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class Price < XDR::Struct
17
+ attribute :n, Int32
18
+ attribute :d, Int32
19
+ end
20
+ end