stellar-base 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.travis.yml +15 -0
  4. data/.yardopts +8 -0
  5. data/Gemfile +15 -0
  6. data/Guardfile +5 -0
  7. data/LICENSE.txt +202 -0
  8. data/README.md +79 -0
  9. data/Rakefile +6 -0
  10. data/examples/low_level_transaction_post.rb +53 -0
  11. data/examples/mid_level_transaction_post.rb +34 -0
  12. data/examples/non_native_payment.rb +60 -0
  13. data/generated/stellar/account_entry.rb +37 -0
  14. data/generated/stellar/account_flags.rb +20 -0
  15. data/generated/stellar/account_merge_result.rb +25 -0
  16. data/generated/stellar/account_merge_result_code.rb +30 -0
  17. data/generated/stellar/allow_trust_op/currency.rb +28 -0
  18. data/generated/stellar/allow_trust_op.rb +35 -0
  19. data/generated/stellar/allow_trust_result.rb +25 -0
  20. data/generated/stellar/allow_trust_result_code.rb +28 -0
  21. data/generated/stellar/bucket_entry.rb +28 -0
  22. data/generated/stellar/bucket_entry_type.rb +22 -0
  23. data/generated/stellar/change_trust_op.rb +22 -0
  24. data/generated/stellar/change_trust_result.rb +25 -0
  25. data/generated/stellar/change_trust_result_code.rb +28 -0
  26. data/generated/stellar/claim_offer_atom.rb +29 -0
  27. data/generated/stellar/create_offer_effect.rb +24 -0
  28. data/generated/stellar/create_offer_op.rb +28 -0
  29. data/generated/stellar/create_offer_result.rb +26 -0
  30. data/generated/stellar/create_offer_result_code.rb +45 -0
  31. data/generated/stellar/create_offer_success_result/offer.rb +30 -0
  32. data/generated/stellar/create_offer_success_result.rb +34 -0
  33. data/generated/stellar/currency.rb +29 -0
  34. data/generated/stellar/currency_type.rb +22 -0
  35. data/generated/stellar/decorated_signature.rb +20 -0
  36. data/generated/stellar/dont_have.rb +20 -0
  37. data/generated/stellar/error.rb +20 -0
  38. data/generated/stellar/hello.rb +24 -0
  39. data/generated/stellar/inflation_payout.rb +20 -0
  40. data/generated/stellar/inflation_result.rb +26 -0
  41. data/generated/stellar/inflation_result_code.rb +24 -0
  42. data/generated/stellar/iso_currency_issuer.rb +20 -0
  43. data/generated/stellar/ledger_entry.rb +33 -0
  44. data/generated/stellar/ledger_entry_type.rb +24 -0
  45. data/generated/stellar/ledger_header.rb +45 -0
  46. data/generated/stellar/ledger_header_history_entry.rb +20 -0
  47. data/generated/stellar/ledger_key/account.rb +20 -0
  48. data/generated/stellar/ledger_key/offer.rb +22 -0
  49. data/generated/stellar/ledger_key/trust_line.rb +22 -0
  50. data/generated/stellar/ledger_key.rb +50 -0
  51. data/generated/stellar/message_type.rb +45 -0
  52. data/generated/stellar/offer_entry.rb +34 -0
  53. data/generated/stellar/operation/body.rb +49 -0
  54. data/generated/stellar/operation.rb +45 -0
  55. data/generated/stellar/operation_result/tr.rb +49 -0
  56. data/generated/stellar/operation_result.rb +47 -0
  57. data/generated/stellar/operation_result_code.rb +25 -0
  58. data/generated/stellar/operation_type.rb +32 -0
  59. data/generated/stellar/payment_op.rb +35 -0
  60. data/generated/stellar/payment_result.rb +29 -0
  61. data/generated/stellar/payment_result_code.rb +41 -0
  62. data/generated/stellar/payment_success_multi_result.rb +20 -0
  63. data/generated/stellar/peer_address.rb +22 -0
  64. data/generated/stellar/price.rb +20 -0
  65. data/generated/stellar/scp_ballot.rb +20 -0
  66. data/generated/stellar/scp_envelope.rb +22 -0
  67. data/generated/stellar/scp_quorum_set.rb +20 -0
  68. data/generated/stellar/scp_statement/pledges/prepare.rb +24 -0
  69. data/generated/stellar/scp_statement/pledges.rb +40 -0
  70. data/generated/stellar/scp_statement.rb +42 -0
  71. data/generated/stellar/scp_statement_type.rb +26 -0
  72. data/generated/stellar/set_options_op.rb +31 -0
  73. data/generated/stellar/set_options_result.rb +25 -0
  74. data/generated/stellar/set_options_result_code.rb +28 -0
  75. data/generated/stellar/signer.rb +20 -0
  76. data/generated/stellar/simple_payment_result.rb +22 -0
  77. data/generated/stellar/stellar_ballot.rb +22 -0
  78. data/generated/stellar/stellar_ballot_value.rb +22 -0
  79. data/generated/stellar/stellar_message.rb +66 -0
  80. data/generated/stellar/transaction.rb +37 -0
  81. data/generated/stellar/transaction_envelope.rb +20 -0
  82. data/generated/stellar/transaction_history_entry.rb +20 -0
  83. data/generated/stellar/transaction_history_result_entry.rb +20 -0
  84. data/generated/stellar/transaction_meta.rb +18 -0
  85. data/generated/stellar/transaction_result/result.rb +30 -0
  86. data/generated/stellar/transaction_result.rb +33 -0
  87. data/generated/stellar/transaction_result_code.rb +46 -0
  88. data/generated/stellar/transaction_result_pair.rb +20 -0
  89. data/generated/stellar/transaction_result_set.rb +18 -0
  90. data/generated/stellar/transaction_set.rb +20 -0
  91. data/generated/stellar/trust_line_entry.rb +28 -0
  92. data/generated/stellar-base-generated.rb +160 -0
  93. data/lib/stellar/base/version.rb +5 -0
  94. data/lib/stellar/base.rb +1 -0
  95. data/lib/stellar/change_trust_op.rb +10 -0
  96. data/lib/stellar/currency.rb +28 -0
  97. data/lib/stellar/key_pair.rb +94 -0
  98. data/lib/stellar/payment_op.rb +38 -0
  99. data/lib/stellar/transaction.rb +72 -0
  100. data/lib/stellar/transaction_envelope.rb +32 -0
  101. data/lib/stellar/util/base58.rb +127 -0
  102. data/lib/stellar-base.rb +23 -0
  103. data/ruby-stellar-base.gemspec +34 -0
  104. data/spec/lib/stellar/key_pair_spec.rb +199 -0
  105. data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
  106. data/spec/lib/stellar/transaction_spec.rb +43 -0
  107. data/spec/lib/stellar/util/base58_spec.rb +74 -0
  108. data/spec/spec_helper.rb +16 -0
  109. data/spec/support/matchers/be_base58_check.rb +9 -0
  110. data/spec/support/matchers/eq_bytes.rb +5 -0
  111. data/spec/support/matchers/have_length.rb +5 -0
  112. data/tasks/rspec.rake +6 -0
  113. data/tasks/travis.rake +9 -0
  114. data/tasks/xdr.rake +48 -0
  115. data/xdr/SCPXDR.x +61 -0
  116. data/xdr/Stellar-ledger-entries.x +105 -0
  117. data/xdr/Stellar-ledger.x +117 -0
  118. data/xdr/Stellar-overlay.x +100 -0
  119. data/xdr/Stellar-transaction.x +497 -0
  120. data/xdr/Stellar-types.x +53 -0
  121. data/xdr/StellarXDR.x +11 -0
  122. metadata +342 -0
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct PaymentSuccessMultiResult
9
+ # {
10
+ # ClaimOfferAtom offers<>;
11
+ # SimplePaymentResult last;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class PaymentSuccessMultiResult < XDR::Struct
17
+ attribute :offers, XDR::VarArray[ClaimOfferAtom]
18
+ attribute :last, SimplePaymentResult
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
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
+ # Automatically generated on 2015-04-07T10:52:07-07:00
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
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPBallot
9
+ # {
10
+ # uint32 counter; // n
11
+ # Value value; // x
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class SCPBallot < XDR::Struct
17
+ attribute :counter, Uint32
18
+ attribute :value, Value
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPEnvelope
9
+ # {
10
+ # uint256 nodeID; // v
11
+ # SCPStatement statement;
12
+ # Signature signature;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class SCPEnvelope < XDR::Struct
18
+ attribute :node_id, Uint256
19
+ attribute :statement, SCPStatement
20
+ attribute :signature, Signature
21
+ end
22
+ end
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPQuorumSet
9
+ # {
10
+ # uint32 threshold;
11
+ # Hash validators<>;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class SCPQuorumSet < XDR::Struct
17
+ attribute :threshold, Uint32
18
+ attribute :validators, XDR::VarArray[Hash]
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct
9
+ # {
10
+ # SCPBallot excepted<>; // B_c
11
+ # SCPBallot* prepared; // p
12
+ # }
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class SCPStatement
17
+ class Pledges
18
+ class Prepare < XDR::Struct
19
+ attribute :excepted, XDR::VarArray[SCPBallot]
20
+ attribute :prepared, XDR::Option[SCPBallot]
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,40 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union switch (SCPStatementType type)
9
+ # {
10
+ # case PREPARING:
11
+ # struct
12
+ # {
13
+ # SCPBallot excepted<>; // B_c
14
+ # SCPBallot* prepared; // p
15
+ # } prepare;
16
+ # case PREPARED:
17
+ # case COMMITTING:
18
+ # case COMMITTED:
19
+ # void;
20
+ # }
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class SCPStatement
25
+ class Pledges < XDR::Union
26
+ include XDR::Namespace
27
+
28
+ autoload :Prepare
29
+
30
+ switch_on SCPStatementType, :type
31
+
32
+ switch :preparing, :prepare
33
+ switch :prepared
34
+ switch :committing
35
+ switch :committed
36
+
37
+ attribute :prepare, Prepare
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,42 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPStatement
9
+ # {
10
+ # uint64 slotIndex; // i
11
+ # SCPBallot ballot; // b
12
+ # Hash quorumSetHash; // D
13
+ #
14
+ # union switch (SCPStatementType type)
15
+ # {
16
+ # case PREPARING:
17
+ # struct
18
+ # {
19
+ # SCPBallot excepted<>; // B_c
20
+ # SCPBallot* prepared; // p
21
+ # } prepare;
22
+ # case PREPARED:
23
+ # case COMMITTING:
24
+ # case COMMITTED:
25
+ # void;
26
+ # }
27
+ # pledges;
28
+ # };
29
+ #
30
+ # ===========================================================================
31
+ module Stellar
32
+ class SCPStatement < XDR::Struct
33
+ include XDR::Namespace
34
+
35
+ autoload :Pledges
36
+
37
+ attribute :slot_index, Uint64
38
+ attribute :ballot, SCPBallot
39
+ attribute :quorum_set_hash, Hash
40
+ attribute :pledges, Pledges
41
+ end
42
+ end
@@ -0,0 +1,26 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # enum SCPStatementType
9
+ # {
10
+ # PREPARING = 0,
11
+ # PREPARED = 1,
12
+ # COMMITTING = 2,
13
+ # COMMITTED = 3
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SCPStatementType < XDR::Enum
19
+ member :preparing, 0
20
+ member :prepared, 1
21
+ member :committing, 2
22
+ member :committed, 3
23
+
24
+ seal
25
+ end
26
+ end
@@ -0,0 +1,31 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SetOptionsOp
9
+ # {
10
+ # AccountID* inflationDest; // sets the inflation destination
11
+ #
12
+ # uint32* clearFlags; // which flags to clear
13
+ # uint32* setFlags; // which flags to set
14
+ #
15
+ # Thresholds* thresholds; // update the thresholds for the account
16
+ #
17
+ # // Add, update or remove a signer for the account
18
+ # // signer is deleted if the weight is 0
19
+ # Signer* signer;
20
+ # };
21
+ #
22
+ # ===========================================================================
23
+ module Stellar
24
+ class SetOptionsOp < XDR::Struct
25
+ attribute :inflation_dest, XDR::Option[AccountID]
26
+ attribute :clear_flags, XDR::Option[Uint32]
27
+ attribute :set_flags, XDR::Option[Uint32]
28
+ attribute :thresholds, XDR::Option[Thresholds]
29
+ attribute :signer, XDR::Option[Signer]
30
+ end
31
+ end
@@ -0,0 +1,25 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union SetOptionsResult switch (SetOptionsResultCode code)
9
+ # {
10
+ # case SET_OPTIONS_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SetOptionsResult < XDR::Union
19
+ switch_on SetOptionsResultCode, :code
20
+
21
+ switch :set_options_success
22
+ switch :default
23
+
24
+ end
25
+ end
@@ -0,0 +1,28 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # enum SetOptionsResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # SET_OPTIONS_SUCCESS = 0,
12
+ # // codes considered as "failure" for the operation
13
+ # SET_OPTIONS_LOW_RESERVE = 1, // not enough funds to add a signer
14
+ # SET_OPTIONS_TOO_MANY_SIGNERS = 2, // max number of signers already reached
15
+ # SET_OPTIONS_BAD_FLAGS = 3 // invalid combination of clear/set flags
16
+ # };
17
+ #
18
+ # ===========================================================================
19
+ module Stellar
20
+ class SetOptionsResultCode < XDR::Enum
21
+ member :set_options_success, 0
22
+ member :set_options_low_reserve, 1
23
+ member :set_options_too_many_signers, 2
24
+ member :set_options_bad_flags, 3
25
+
26
+ seal
27
+ end
28
+ end
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct Signer
9
+ # {
10
+ # uint256 pubKey;
11
+ # uint32 weight; // really only need 1byte
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class Signer < XDR::Struct
17
+ attribute :pub_key, Uint256
18
+ attribute :weight, Uint32
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SimplePaymentResult
9
+ # {
10
+ # AccountID destination;
11
+ # Currency currency;
12
+ # int64 amount;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class SimplePaymentResult < XDR::Struct
18
+ attribute :destination, AccountID
19
+ attribute :currency, Currency
20
+ attribute :amount, Int64
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct StellarBallot
9
+ # {
10
+ # uint256 nodeID;
11
+ # Signature signature;
12
+ # StellarBallotValue value;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class StellarBallot < XDR::Struct
18
+ attribute :node_id, Uint256
19
+ attribute :signature, Signature
20
+ attribute :value, StellarBallotValue
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct StellarBallotValue
9
+ # {
10
+ # Hash txSetHash;
11
+ # uint64 closeTime;
12
+ # uint32 baseFee;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class StellarBallotValue < XDR::Struct
18
+ attribute :tx_set_hash, Hash
19
+ attribute :close_time, Uint64
20
+ attribute :base_fee, Uint32
21
+ end
22
+ end
@@ -0,0 +1,66 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union StellarMessage switch (MessageType type)
9
+ # {
10
+ # case ERROR_MSG:
11
+ # Error error;
12
+ # case HELLO:
13
+ # Hello hello;
14
+ # case DONT_HAVE:
15
+ # DontHave dontHave;
16
+ # case GET_PEERS:
17
+ # void;
18
+ # case PEERS:
19
+ # PeerAddress peers<>;
20
+ #
21
+ # case GET_TX_SET:
22
+ # uint256 txSetHash;
23
+ # case TX_SET:
24
+ # TransactionSet txSet;
25
+ #
26
+ # case TRANSACTION:
27
+ # TransactionEnvelope transaction;
28
+ #
29
+ # // SCP
30
+ # case GET_SCP_QUORUMSET:
31
+ # uint256 qSetHash;
32
+ # case SCP_QUORUMSET:
33
+ # SCPQuorumSet qSet;
34
+ # case SCP_MESSAGE:
35
+ # SCPEnvelope envelope;
36
+ # };
37
+ #
38
+ # ===========================================================================
39
+ module Stellar
40
+ class StellarMessage < XDR::Union
41
+ switch_on MessageType, :type
42
+
43
+ switch :error_msg, :error
44
+ switch :hello, :hello
45
+ switch :dont_have, :dont_have
46
+ switch :get_peers
47
+ switch :peers, :peers
48
+ switch :get_tx_set, :tx_set_hash
49
+ switch :tx_set, :tx_set
50
+ switch :transaction, :transaction
51
+ switch :get_scp_quorumset, :q_set_hash
52
+ switch :scp_quorumset, :q_set
53
+ switch :scp_message, :envelope
54
+
55
+ attribute :error, Error
56
+ attribute :hello, Hello
57
+ attribute :dont_have, DontHave
58
+ attribute :peers, XDR::VarArray[PeerAddress]
59
+ attribute :tx_set_hash, Uint256
60
+ attribute :tx_set, TransactionSet
61
+ attribute :transaction, TransactionEnvelope
62
+ attribute :q_set_hash, Uint256
63
+ attribute :q_set, SCPQuorumSet
64
+ attribute :envelope, SCPEnvelope
65
+ end
66
+ end
@@ -0,0 +1,37 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct Transaction
9
+ # {
10
+ # // account used to run the transaction
11
+ # AccountID sourceAccount;
12
+ #
13
+ # // maximum fee this transaction can collect
14
+ # // the transaction is aborted if the fee is higher
15
+ # int32 maxFee;
16
+ #
17
+ # // sequence number to consume in the account
18
+ # SequenceNumber seqNum;
19
+ #
20
+ # // validity range (inclusive) for the ledger sequence number
21
+ # uint32 minLedger;
22
+ # uint32 maxLedger;
23
+ #
24
+ # Operation operations<100>;
25
+ # };
26
+ #
27
+ # ===========================================================================
28
+ module Stellar
29
+ class Transaction < XDR::Struct
30
+ attribute :source_account, AccountID
31
+ attribute :max_fee, Int32
32
+ attribute :seq_num, SequenceNumber
33
+ attribute :min_ledger, Uint32
34
+ attribute :max_ledger, Uint32
35
+ attribute :operations, XDR::VarArray[Operation, 100]
36
+ end
37
+ end
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct TransactionEnvelope
9
+ # {
10
+ # Transaction tx;
11
+ # DecoratedSignature signatures<20>;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class TransactionEnvelope < XDR::Struct
17
+ attribute :tx, Transaction
18
+ attribute :signatures, XDR::VarArray[DecoratedSignature, 20]
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct TransactionHistoryEntry
9
+ # {
10
+ # uint32 ledgerSeq;
11
+ # TransactionSet txSet;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class TransactionHistoryEntry < XDR::Struct
17
+ attribute :ledger_seq, Uint32
18
+ attribute :tx_set, TransactionSet
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct TransactionHistoryResultEntry
9
+ # {
10
+ # uint32 ledgerSeq;
11
+ # TransactionResultSet txResultSet;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class TransactionHistoryResultEntry < XDR::Struct
17
+ attribute :ledger_seq, Uint32
18
+ attribute :tx_result_set, TransactionResultSet
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct TransactionMeta
9
+ # {
10
+ # BucketEntry entries<>;
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class TransactionMeta < XDR::Struct
16
+ attribute :entries, XDR::VarArray[BucketEntry]
17
+ end
18
+ end
@@ -0,0 +1,30 @@
1
+ # Automatically generated on 2015-04-07T10:52:07-07:00
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union switch (TransactionResultCode code)
9
+ # {
10
+ # case txSUCCESS:
11
+ # case txFAILED:
12
+ # OperationResult results<>;
13
+ # default:
14
+ # void;
15
+ # }
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class TransactionResult
20
+ class Result < XDR::Union
21
+ switch_on TransactionResultCode, :code
22
+
23
+ switch :tx_success, :results
24
+ switch :tx_failed, :results
25
+ switch :default
26
+
27
+ attribute :results, XDR::VarArray[OperationResult]
28
+ end
29
+ end
30
+ end