stellar-base 0.22.0 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/{LICENSE.txt → LICENSE} +0 -0
  4. data/README.md +0 -4
  5. data/generated/stellar-base-generated.rb +10 -1
  6. data/generated/stellar/allow_trust_op.rb +3 -2
  7. data/generated/stellar/authenticated_message.rb +4 -4
  8. data/generated/stellar/authenticated_message/v0.rb +4 -4
  9. data/generated/stellar/change_trust_result_code.rb +1 -1
  10. data/generated/stellar/crypto_key_type.rb +8 -4
  11. data/generated/stellar/curve25519_public.rb +1 -1
  12. data/generated/stellar/curve25519_secret.rb +1 -1
  13. data/generated/stellar/envelope_type.rb +9 -5
  14. data/generated/stellar/fee_bump_transaction.rb +39 -0
  15. data/generated/stellar/fee_bump_transaction/ext.rb +24 -0
  16. data/generated/stellar/fee_bump_transaction/inner_tx.rb +25 -0
  17. data/generated/stellar/fee_bump_transaction_envelope.rb +22 -0
  18. data/generated/stellar/hmac_sha256_key.rb +1 -1
  19. data/generated/stellar/hmac_sha256_mac.rb +1 -1
  20. data/generated/stellar/inner_transaction_result.rb +56 -0
  21. data/generated/stellar/inner_transaction_result/ext.rb +24 -0
  22. data/generated/stellar/inner_transaction_result/result.rb +52 -0
  23. data/generated/stellar/inner_transaction_result_pair.rb +20 -0
  24. data/generated/stellar/ledger_close_meta.rb +1 -1
  25. data/generated/stellar/manage_buy_offer_result_code.rb +5 -4
  26. data/generated/stellar/manage_sell_offer_result_code.rb +12 -8
  27. data/generated/stellar/muxed_account.rb +35 -0
  28. data/generated/stellar/muxed_account/med25519.rb +22 -0
  29. data/generated/stellar/operation.rb +3 -3
  30. data/generated/stellar/operation/body.rb +2 -2
  31. data/generated/stellar/operation_result.rb +1 -1
  32. data/generated/stellar/operation_result/tr.rb +1 -1
  33. data/generated/stellar/operation_result_code.rb +3 -3
  34. data/generated/stellar/path_payment_strict_receive_op.rb +4 -4
  35. data/generated/stellar/path_payment_strict_receive_result_code.rb +21 -12
  36. data/generated/stellar/path_payment_strict_send_op.rb +6 -6
  37. data/generated/stellar/path_payment_strict_send_result_code.rb +20 -12
  38. data/generated/stellar/payment_op.rb +4 -4
  39. data/generated/stellar/survey_response_body.rb +2 -2
  40. data/generated/stellar/transaction.rb +2 -2
  41. data/generated/stellar/transaction_envelope.rb +17 -8
  42. data/generated/stellar/transaction_result.rb +3 -0
  43. data/generated/stellar/transaction_result/result.rb +9 -3
  44. data/generated/stellar/transaction_result_code.rb +21 -14
  45. data/generated/stellar/transaction_signature_payload.rb +3 -1
  46. data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +7 -3
  47. data/generated/stellar/transaction_v0.rb +39 -0
  48. data/generated/stellar/transaction_v0/ext.rb +24 -0
  49. data/generated/stellar/transaction_v0_envelope.rb +22 -0
  50. data/generated/stellar/transaction_v1_envelope.rb +22 -0
  51. data/generated/stellar/trust_line_flags.rb +6 -2
  52. data/lib/stellar-base.rb +27 -25
  53. data/lib/stellar/account_flags.rb +2 -4
  54. data/lib/stellar/asset.rb +6 -6
  55. data/lib/stellar/base.rb +1 -1
  56. data/lib/stellar/{base/compat.rb → compat.rb} +6 -7
  57. data/lib/stellar/concerns/transaction.rb +49 -0
  58. data/lib/stellar/convert.rb +2 -2
  59. data/lib/stellar/factories.rb +1 -3
  60. data/lib/stellar/fee_bump_transaction.rb +21 -0
  61. data/lib/stellar/key_pair.rb +9 -6
  62. data/lib/stellar/networks.rb +5 -7
  63. data/lib/stellar/operation.rb +421 -416
  64. data/lib/stellar/path_payment_strict_receive_result.rb +1 -2
  65. data/lib/stellar/price.rb +2 -4
  66. data/lib/stellar/signer_key.rb +4 -8
  67. data/lib/stellar/thresholds.rb +5 -7
  68. data/lib/stellar/transaction.rb +169 -195
  69. data/lib/stellar/transaction_builder.rb +59 -25
  70. data/lib/stellar/transaction_envelope.rb +40 -8
  71. data/lib/stellar/transaction_v0.rb +51 -0
  72. data/lib/stellar/util/continued_fraction.rb +19 -19
  73. data/lib/stellar/util/strkey.rb +39 -14
  74. data/lib/stellar/{base/version.rb → version.rb} +1 -1
  75. metadata +35 -204
  76. data/.gitignore +0 -17
  77. data/.travis.yml +0 -16
  78. data/.yardopts +0 -8
  79. data/CONTRIBUTING.md +0 -48
  80. data/Gemfile +0 -9
  81. data/Guardfile +0 -5
  82. data/Rakefile +0 -4
  83. data/examples/allow_trust.rb +0 -51
  84. data/examples/create_account.rb +0 -26
  85. data/examples/low_level_transaction_post.rb +0 -46
  86. data/examples/mid_level_transaction_post.rb +0 -33
  87. data/examples/non_native_payment.rb +0 -60
  88. data/examples/offer.rb +0 -75
  89. data/examples/transaction_merge.rb +0 -23
  90. data/ruby-stellar-base.gemspec +0 -34
  91. data/spec/lib/stellar/account_flags_spec.rb +0 -19
  92. data/spec/lib/stellar/asset_spec.rb +0 -45
  93. data/spec/lib/stellar/convert_spec.rb +0 -61
  94. data/spec/lib/stellar/key_pair_spec.rb +0 -251
  95. data/spec/lib/stellar/networks_spec.rb +0 -77
  96. data/spec/lib/stellar/operation_spec.rb +0 -131
  97. data/spec/lib/stellar/path_payment_strict_receive_result_spec.rb +0 -95
  98. data/spec/lib/stellar/price_spec.rb +0 -34
  99. data/spec/lib/stellar/signer_key_spec.rb +0 -26
  100. data/spec/lib/stellar/thresholds_spec.rb +0 -62
  101. data/spec/lib/stellar/transaction_builder_spec.rb +0 -263
  102. data/spec/lib/stellar/transaction_envelope_spec.rb +0 -93
  103. data/spec/lib/stellar/transaction_spec.rb +0 -132
  104. data/spec/lib/stellar/util/strkey_spec.rb +0 -54
  105. data/spec/spec_helper.rb +0 -16
  106. data/spec/support/matchers/be_strkey.rb +0 -9
  107. data/spec/support/matchers/eq_bytes.rb +0 -5
  108. data/spec/support/matchers/have_length.rb +0 -5
  109. data/tasks/rspec.rake +0 -6
  110. data/tasks/travis.rake +0 -1
  111. data/tasks/xdr.rake +0 -45
  112. data/xdr/Stellar-SCP.x +0 -86
  113. data/xdr/Stellar-ledger-entries.x +0 -295
  114. data/xdr/Stellar-ledger.x +0 -372
  115. data/xdr/Stellar-overlay.x +0 -229
  116. data/xdr/Stellar-transaction.x +0 -901
  117. data/xdr/Stellar-types.x +0 -81
@@ -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 InnerTransactionResultPair
9
+ # {
10
+ # Hash transactionHash; // hash of the inner transaction
11
+ # InnerTransactionResult result; // result for the inner transaction
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class InnerTransactionResultPair < XDR::Struct
17
+ attribute :transaction_hash, Hash
18
+ attribute :result, InnerTransactionResult
19
+ end
20
+ end
@@ -8,7 +8,7 @@ require 'xdr'
8
8
  # union LedgerCloseMeta switch (int v)
9
9
  # {
10
10
  # case 0:
11
- # LedgerCloseMetaV0 v0;
11
+ # LedgerCloseMetaV0 v0;
12
12
  # };
13
13
  #
14
14
  # ===========================================================================
@@ -16,14 +16,15 @@ require 'xdr'
16
16
  # MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
17
17
  # MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
18
18
  # MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
19
- # MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
20
- # MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
21
- # MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
19
+ # MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
20
+ # MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
21
+ # MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
22
22
  # MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
23
23
  # MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying
24
24
  #
25
25
  # // update errors
26
- # MANAGE_BUY_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer
26
+ # MANAGE_BUY_OFFER_NOT_FOUND =
27
+ # -11, // offerID does not match an existing offer
27
28
  #
28
29
  # MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
29
30
  # };
@@ -11,21 +11,25 @@ require 'xdr'
11
11
  # MANAGE_SELL_OFFER_SUCCESS = 0,
12
12
  #
13
13
  # // codes considered as "failure" for the operation
14
- # MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid
15
- # MANAGE_SELL_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling
16
- # MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
14
+ # MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid
15
+ # MANAGE_SELL_OFFER_SELL_NO_TRUST =
16
+ # -2, // no trust line for what we're selling
17
+ # MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
17
18
  # MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
18
19
  # MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
19
- # MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
20
- # MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
21
- # MANAGE_SELL_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
20
+ # MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
21
+ # MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
22
+ # MANAGE_SELL_OFFER_CROSS_SELF =
23
+ # -8, // would cross an offer from the same user
22
24
  # MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
23
25
  # MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying
24
26
  #
25
27
  # // update errors
26
- # MANAGE_SELL_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer
28
+ # MANAGE_SELL_OFFER_NOT_FOUND =
29
+ # -11, // offerID does not match an existing offer
27
30
  #
28
- # MANAGE_SELL_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
31
+ # MANAGE_SELL_OFFER_LOW_RESERVE =
32
+ # -12 // not enough funds to create a new Offer
29
33
  # };
30
34
  #
31
35
  # ===========================================================================
@@ -0,0 +1,35 @@
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 MuxedAccount switch (CryptoKeyType type)
9
+ # {
10
+ # case KEY_TYPE_ED25519:
11
+ # uint256 ed25519;
12
+ # case KEY_TYPE_MUXED_ED25519:
13
+ # struct
14
+ # {
15
+ # uint64 id;
16
+ # uint256 ed25519;
17
+ # } med25519;
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class MuxedAccount < XDR::Union
23
+ include XDR::Namespace
24
+
25
+ autoload :Med25519
26
+
27
+ switch_on CryptoKeyType, :type
28
+
29
+ switch :key_type_ed25519, :ed25519
30
+ switch :key_type_muxed_ed25519, :med25519
31
+
32
+ attribute :ed25519, Uint256
33
+ attribute :med25519, Med25519
34
+ end
35
+ 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
+ # uint64 id;
11
+ # uint256 ed25519;
12
+ # }
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class MuxedAccount
17
+ class Med25519 < XDR::Struct
18
+ attribute :id, Uint64
19
+ attribute :ed25519, Uint256
20
+ end
21
+ end
22
+ end
@@ -10,7 +10,7 @@ require 'xdr'
10
10
  # // sourceAccount is the account used to run the operation
11
11
  # // if not set, the runtime defaults to "sourceAccount" specified at
12
12
  # // the transaction level
13
- # AccountID* sourceAccount;
13
+ # MuxedAccount* sourceAccount;
14
14
  #
15
15
  # union switch (OperationType type)
16
16
  # {
@@ -31,7 +31,7 @@ require 'xdr'
31
31
  # case ALLOW_TRUST:
32
32
  # AllowTrustOp allowTrustOp;
33
33
  # case ACCOUNT_MERGE:
34
- # AccountID destination;
34
+ # MuxedAccount destination;
35
35
  # case INFLATION:
36
36
  # void;
37
37
  # case MANAGE_DATA:
@@ -53,7 +53,7 @@ module Stellar
53
53
 
54
54
  autoload :Body
55
55
 
56
- attribute :source_account, XDR::Option[AccountID]
56
+ attribute :source_account, XDR::Option[MuxedAccount]
57
57
  attribute :body, Body
58
58
  end
59
59
  end
@@ -24,7 +24,7 @@ require 'xdr'
24
24
  # case ALLOW_TRUST:
25
25
  # AllowTrustOp allowTrustOp;
26
26
  # case ACCOUNT_MERGE:
27
- # AccountID destination;
27
+ # MuxedAccount destination;
28
28
  # case INFLATION:
29
29
  # void;
30
30
  # case MANAGE_DATA:
@@ -66,7 +66,7 @@ module Stellar
66
66
  attribute :set_options_op, SetOptionsOp
67
67
  attribute :change_trust_op, ChangeTrustOp
68
68
  attribute :allow_trust_op, AllowTrustOp
69
- attribute :destination, AccountID
69
+ attribute :destination, MuxedAccount
70
70
  attribute :manage_data_op, ManageDataOp
71
71
  attribute :bump_sequence_op, BumpSequenceOp
72
72
  attribute :manage_buy_offer_op, ManageBuyOfferOp
@@ -35,7 +35,7 @@ require 'xdr'
35
35
  # case BUMP_SEQUENCE:
36
36
  # BumpSequenceResult bumpSeqResult;
37
37
  # case MANAGE_BUY_OFFER:
38
- # ManageBuyOfferResult manageBuyOfferResult;
38
+ # ManageBuyOfferResult manageBuyOfferResult;
39
39
  # case PATH_PAYMENT_STRICT_SEND:
40
40
  # PathPaymentStrictSendResult pathPaymentStrictSendResult;
41
41
  # }
@@ -32,7 +32,7 @@ require 'xdr'
32
32
  # case BUMP_SEQUENCE:
33
33
  # BumpSequenceResult bumpSeqResult;
34
34
  # case MANAGE_BUY_OFFER:
35
- # ManageBuyOfferResult manageBuyOfferResult;
35
+ # ManageBuyOfferResult manageBuyOfferResult;
36
36
  # case PATH_PAYMENT_STRICT_SEND:
37
37
  # PathPaymentStrictSendResult pathPaymentStrictSendResult;
38
38
  # }
@@ -9,9 +9,9 @@ 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
15
  # opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached
16
16
  # opEXCEEDED_WORK_LIMIT = -5 // operation did too much work
17
17
  # };
@@ -12,9 +12,9 @@ require 'xdr'
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
  # };
@@ -24,7 +24,7 @@ module Stellar
24
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]
@@ -11,18 +11,27 @@ require 'xdr'
11
11
  # PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success
12
12
  #
13
13
  # // codes considered as "failure" for the operation
14
- # PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input
15
- # PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = -2, // not enough funds in source account
16
- # PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = -3, // no trust line on source account
17
- # PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
18
- # PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = -5, // destination account does not exist
19
- # PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = -6, // dest missing a trust line for asset
20
- # PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
21
- # PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = -8, // dest would go above their limit
22
- # PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset
23
- # PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path
24
- # PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = -11, // would cross one of its own offers
25
- # PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax
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
26
35
  # };
27
36
  #
28
37
  # ===========================================================================
@@ -10,11 +10,11 @@ require 'xdr'
10
10
  # Asset sendAsset; // asset we pay with
11
11
  # int64 sendAmount; // amount of sendAsset to send (excluding fees)
12
12
  #
13
- # AccountID 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
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
18
  #
19
19
  # Asset path<5>; // additional hops it must go through to get there
20
20
  # };
@@ -24,7 +24,7 @@ module Stellar
24
24
  class PathPaymentStrictSendOp < XDR::Struct
25
25
  attribute :send_asset, Asset
26
26
  attribute :send_amount, Int64
27
- attribute :destination, AccountID
27
+ attribute :destination, MuxedAccount
28
28
  attribute :dest_asset, Asset
29
29
  attribute :dest_min, Int64
30
30
  attribute :path, XDR::VarArray[Asset, 5]
@@ -11,18 +11,26 @@ require 'xdr'
11
11
  # PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success
12
12
  #
13
13
  # // codes considered as "failure" for the operation
14
- # PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input
15
- # PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = -2, // not enough funds in source account
16
- # PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = -3, // no trust line on source account
17
- # PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
18
- # PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = -5, // destination account does not exist
19
- # PATH_PAYMENT_STRICT_SEND_NO_TRUST = -6, // dest missing a trust line for asset
20
- # PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
21
- # PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit
22
- # PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset
23
- # PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path
24
- # PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = -11, // would cross one of its own offers
25
- # PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin
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
26
34
  # };
27
35
  #
28
36
  # ===========================================================================
@@ -7,15 +7,15 @@ require 'xdr'
7
7
  #
8
8
  # struct PaymentOp
9
9
  # {
10
- # AccountID destination; // recipient of the payment
11
- # Asset asset; // what they end up with
12
- # int64 amount; // amount they end up with
10
+ # MuxedAccount destination; // recipient of the payment
11
+ # Asset asset; // what they end up with
12
+ # int64 amount; // amount they end up with
13
13
  # };
14
14
  #
15
15
  # ===========================================================================
16
16
  module Stellar
17
17
  class PaymentOp < XDR::Struct
18
- attribute :destination, AccountID
18
+ attribute :destination, MuxedAccount
19
19
  attribute :asset, Asset
20
20
  attribute :amount, Int64
21
21
  end
@@ -7,8 +7,8 @@ require 'xdr'
7
7
  #
8
8
  # union SurveyResponseBody switch (SurveyMessageCommandType type)
9
9
  # {
10
- # case SURVEY_TOPOLOGY:
11
- # TopologyResponseBody topologyResponseBody;
10
+ # case SURVEY_TOPOLOGY:
11
+ # TopologyResponseBody topologyResponseBody;
12
12
  # };
13
13
  #
14
14
  # ===========================================================================
@@ -8,7 +8,7 @@ require 'xdr'
8
8
  # struct Transaction
9
9
  # {
10
10
  # // account used to run the transaction
11
- # AccountID sourceAccount;
11
+ # MuxedAccount sourceAccount;
12
12
  #
13
13
  # // the fee the sourceAccount will pay
14
14
  # uint32 fee;
@@ -39,7 +39,7 @@ module Stellar
39
39
 
40
40
  autoload :Ext
41
41
 
42
- attribute :source_account, AccountID
42
+ attribute :source_account, MuxedAccount
43
43
  attribute :fee, Uint32
44
44
  attribute :seq_num, SequenceNumber
45
45
  attribute :time_bounds, XDR::Option[TimeBounds]
@@ -5,18 +5,27 @@ require 'xdr'
5
5
 
6
6
  # === xdr source ============================================================
7
7
  #
8
- # struct TransactionEnvelope
8
+ # union TransactionEnvelope switch (EnvelopeType type)
9
9
  # {
10
- # Transaction tx;
11
- # /* Each decorated signature is a signature over the SHA256 hash of
12
- # * a TransactionSignaturePayload */
13
- # DecoratedSignature signatures<20>;
10
+ # case ENVELOPE_TYPE_TX_V0:
11
+ # TransactionV0Envelope v0;
12
+ # case ENVELOPE_TYPE_TX:
13
+ # TransactionV1Envelope v1;
14
+ # case ENVELOPE_TYPE_TX_FEE_BUMP:
15
+ # FeeBumpTransactionEnvelope feeBump;
14
16
  # };
15
17
  #
16
18
  # ===========================================================================
17
19
  module Stellar
18
- class TransactionEnvelope < XDR::Struct
19
- attribute :tx, Transaction
20
- attribute :signatures, XDR::VarArray[DecoratedSignature, 20]
20
+ class TransactionEnvelope < XDR::Union
21
+ switch_on EnvelopeType, :type
22
+
23
+ switch :envelope_type_tx_v0, :v0
24
+ switch :envelope_type_tx, :v1
25
+ switch :envelope_type_tx_fee_bump, :fee_bump
26
+
27
+ attribute :v0, TransactionV0Envelope
28
+ attribute :v1, TransactionV1Envelope
29
+ attribute :fee_bump, FeeBumpTransactionEnvelope
21
30
  end
22
31
  end
@@ -11,6 +11,9 @@ require 'xdr'
11
11
  #
12
12
  # union switch (TransactionResultCode code)
13
13
  # {
14
+ # case txFEE_BUMP_INNER_SUCCESS:
15
+ # case txFEE_BUMP_INNER_FAILED:
16
+ # InnerTransactionResultPair innerResultPair;
14
17
  # case txSUCCESS:
15
18
  # case txFAILED:
16
19
  # OperationResult results<>;