stellar-base 0.18.0 → 0.23.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +2 -3
- data/generated/stellar-base-generated.rb +45 -8
- data/generated/stellar/allow_trust_op.rb +5 -4
- data/generated/stellar/allow_trust_op/asset.rb +4 -4
- data/generated/stellar/asset.rb +2 -2
- data/generated/stellar/asset/alpha_num12.rb +2 -2
- data/generated/stellar/asset/alpha_num4.rb +2 -2
- data/generated/stellar/authenticated_message.rb +4 -4
- data/generated/stellar/authenticated_message/v0.rb +4 -4
- data/generated/stellar/bucket_entry.rb +6 -0
- data/generated/stellar/bucket_entry_type.rb +8 -2
- data/generated/stellar/bucket_metadata.rb +32 -0
- data/generated/stellar/bucket_metadata/ext.rb +24 -0
- data/generated/stellar/claim_offer_atom.rb +2 -2
- data/generated/stellar/{create_passive_offer_op.rb → create_passive_sell_offer_op.rb} +2 -2
- data/generated/stellar/crypto_key_type.rb +8 -4
- data/generated/stellar/curve25519_public.rb +1 -1
- data/generated/stellar/curve25519_secret.rb +1 -1
- data/generated/stellar/envelope_type.rb +10 -4
- data/generated/stellar/fee_bump_transaction.rb +39 -0
- data/generated/stellar/fee_bump_transaction/ext.rb +24 -0
- data/generated/stellar/fee_bump_transaction/inner_tx.rb +25 -0
- data/generated/stellar/fee_bump_transaction_envelope.rb +22 -0
- data/generated/stellar/hmac_sha256_key.rb +1 -1
- data/generated/stellar/hmac_sha256_mac.rb +1 -1
- data/generated/stellar/inner_transaction_result.rb +56 -0
- data/generated/stellar/inner_transaction_result/ext.rb +24 -0
- data/generated/stellar/inner_transaction_result/result.rb +52 -0
- data/generated/stellar/inner_transaction_result_pair.rb +20 -0
- data/generated/stellar/ledger_close_meta.rb +23 -0
- data/generated/stellar/ledger_close_meta_v0.rb +35 -0
- data/generated/stellar/ledger_close_value_signature.rb +20 -0
- data/generated/stellar/ledger_key.rb +1 -1
- data/generated/stellar/ledger_key/offer.rb +2 -2
- data/generated/stellar/manage_buy_offer_op.rb +29 -0
- data/generated/stellar/{manage_offer_result.rb → manage_buy_offer_result.rb} +5 -5
- data/generated/stellar/manage_buy_offer_result_code.rb +51 -0
- data/generated/stellar/{manage_offer_op.rb → manage_sell_offer_op.rb} +4 -4
- data/generated/stellar/manage_sell_offer_result.rb +26 -0
- data/generated/stellar/manage_sell_offer_result_code.rb +54 -0
- data/generated/stellar/message_type.rb +6 -1
- data/generated/stellar/muxed_account.rb +35 -0
- data/generated/stellar/muxed_account/med25519.rb +22 -0
- data/generated/stellar/offer_entry.rb +2 -2
- data/generated/stellar/operation.rb +13 -9
- data/generated/stellar/operation/body.rb +37 -29
- data/generated/stellar/operation_result.rb +10 -6
- data/generated/stellar/operation_result/tr.rb +38 -30
- data/generated/stellar/operation_result_code.rb +11 -7
- data/generated/stellar/operation_type.rb +20 -16
- data/generated/stellar/{path_payment_op.rb → path_payment_strict_receive_op.rb} +6 -6
- data/generated/stellar/path_payment_strict_receive_result.rb +38 -0
- data/generated/stellar/path_payment_strict_receive_result/success.rb +22 -0
- data/generated/stellar/path_payment_strict_receive_result_code.rb +56 -0
- data/generated/stellar/path_payment_strict_send_op.rb +32 -0
- data/generated/stellar/{path_payment_result.rb → path_payment_strict_send_result.rb} +7 -7
- data/generated/stellar/{path_payment_result → path_payment_strict_send_result}/success.rb +1 -1
- data/generated/stellar/path_payment_strict_send_result_code.rb +55 -0
- data/generated/stellar/payment_op.rb +4 -4
- data/generated/stellar/peer_stats.rb +48 -0
- data/generated/stellar/signed_survey_request_message.rb +20 -0
- data/generated/stellar/signed_survey_response_message.rb +20 -0
- data/generated/stellar/signer.rb +1 -1
- data/generated/stellar/stellar_message.rb +22 -12
- data/generated/stellar/stellar_value.rb +7 -5
- data/generated/stellar/stellar_value/ext.rb +8 -4
- data/generated/stellar/stellar_value_type.rb +22 -0
- data/generated/stellar/survey_message_command_type.rb +20 -0
- data/generated/stellar/survey_request_message.rb +26 -0
- data/generated/stellar/survey_response_body.rb +23 -0
- data/generated/stellar/survey_response_message.rb +26 -0
- data/generated/stellar/time_bounds.rb +4 -4
- data/generated/stellar/topology_response_body.rb +25 -0
- data/generated/stellar/transaction.rb +4 -4
- data/generated/stellar/transaction_envelope.rb +17 -8
- data/generated/stellar/transaction_meta.rb +4 -0
- data/generated/stellar/transaction_meta_v1.rb +1 -1
- data/generated/stellar/transaction_meta_v2.rb +24 -0
- data/generated/stellar/transaction_result.rb +3 -0
- data/generated/stellar/transaction_result/result.rb +9 -3
- data/generated/stellar/transaction_result_code.rb +21 -14
- data/generated/stellar/transaction_result_meta.rb +22 -0
- data/generated/stellar/transaction_signature_payload.rb +3 -1
- data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +7 -3
- data/generated/stellar/transaction_v0.rb +39 -0
- data/generated/stellar/transaction_v0/ext.rb +24 -0
- data/generated/stellar/transaction_v0_envelope.rb +22 -0
- data/generated/stellar/transaction_v1_envelope.rb +22 -0
- data/generated/stellar/trust_line_flags.rb +6 -2
- data/generated/stellar/upgrade_entry_meta.rb +20 -0
- data/lib/stellar-base.rb +28 -23
- data/lib/stellar/account_flags.rb +2 -4
- data/lib/stellar/asset.rb +6 -6
- data/lib/stellar/base.rb +1 -1
- data/lib/stellar/compat.rb +21 -0
- data/lib/stellar/concerns/transaction.rb +49 -0
- data/lib/stellar/convert.rb +2 -2
- data/lib/stellar/factories.rb +1 -3
- data/lib/stellar/fee_bump_transaction.rb +21 -0
- data/lib/stellar/key_pair.rb +9 -6
- data/lib/stellar/networks.rb +5 -7
- data/lib/stellar/operation.rb +428 -317
- data/lib/stellar/{path_payment_result.rb → path_payment_strict_receive_result.rb} +2 -3
- data/lib/stellar/price.rb +2 -4
- data/lib/stellar/signer_key.rb +4 -8
- data/lib/stellar/thresholds.rb +5 -7
- data/lib/stellar/transaction.rb +154 -169
- data/lib/stellar/transaction_builder.rb +149 -0
- data/lib/stellar/transaction_envelope.rb +40 -8
- data/lib/stellar/transaction_v0.rb +39 -0
- data/lib/stellar/util/continued_fraction.rb +19 -19
- data/lib/stellar/util/strkey.rb +39 -14
- data/lib/stellar/{base/version.rb → version.rb} +1 -1
- metadata +69 -211
- data/.gitignore +0 -17
- data/.travis.yml +0 -14
- data/.yardopts +0 -8
- data/CHANGELOG.md +0 -120
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -15
- data/Guardfile +0 -5
- data/Rakefile +0 -4
- data/examples/create_account.rb +0 -26
- data/examples/low_level_transaction_post.rb +0 -46
- data/examples/mid_level_transaction_post.rb +0 -33
- data/examples/non_native_payment.rb +0 -60
- data/examples/offer.rb +0 -75
- data/examples/transaction_merge.rb +0 -23
- data/generated/stellar/manage_offer_result_code.rb +0 -50
- data/generated/stellar/path_payment_result_code.rb +0 -47
- data/ruby-stellar-base.gemspec +0 -34
- data/spec/lib/stellar/account_flags_spec.rb +0 -19
- data/spec/lib/stellar/asset_spec.rb +0 -45
- data/spec/lib/stellar/convert_spec.rb +0 -61
- data/spec/lib/stellar/key_pair_spec.rb +0 -251
- data/spec/lib/stellar/networks_spec.rb +0 -77
- data/spec/lib/stellar/operation_spec.rb +0 -71
- data/spec/lib/stellar/path_payment_result_spec.rb +0 -95
- data/spec/lib/stellar/price_spec.rb +0 -34
- data/spec/lib/stellar/signer_key_spec.rb +0 -26
- data/spec/lib/stellar/thresholds_spec.rb +0 -62
- data/spec/lib/stellar/transaction_envelope_spec.rb +0 -93
- data/spec/lib/stellar/transaction_spec.rb +0 -100
- data/spec/lib/stellar/util/strkey_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -16
- data/spec/support/matchers/be_strkey.rb +0 -9
- data/spec/support/matchers/eq_bytes.rb +0 -5
- data/spec/support/matchers/have_length.rb +0 -5
- data/tasks/rspec.rake +0 -6
- data/tasks/travis.rake +0 -1
- data/tasks/xdr.rake +0 -50
- data/xdr/Stellar-SCP.x +0 -86
- data/xdr/Stellar-ledger-entries.x +0 -288
- data/xdr/Stellar-ledger.x +0 -283
- data/xdr/Stellar-overlay.x +0 -146
- data/xdr/Stellar-transaction.x +0 -777
- data/xdr/Stellar-types.x +0 -81
@@ -7,15 +7,15 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct PaymentOp
|
9
9
|
# {
|
10
|
-
#
|
11
|
-
# Asset asset;
|
12
|
-
# int64 amount;
|
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,
|
18
|
+
attribute :destination, MuxedAccount
|
19
19
|
attribute :asset, Asset
|
20
20
|
attribute :amount, Int64
|
21
21
|
end
|
@@ -0,0 +1,48 @@
|
|
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 PeerStats
|
9
|
+
# {
|
10
|
+
# NodeID id;
|
11
|
+
# string versionStr<100>;
|
12
|
+
# uint64 messagesRead;
|
13
|
+
# uint64 messagesWritten;
|
14
|
+
# uint64 bytesRead;
|
15
|
+
# uint64 bytesWritten;
|
16
|
+
# uint64 secondsConnected;
|
17
|
+
#
|
18
|
+
# uint64 uniqueFloodBytesRecv;
|
19
|
+
# uint64 duplicateFloodBytesRecv;
|
20
|
+
# uint64 uniqueFetchBytesRecv;
|
21
|
+
# uint64 duplicateFetchBytesRecv;
|
22
|
+
#
|
23
|
+
# uint64 uniqueFloodMessageRecv;
|
24
|
+
# uint64 duplicateFloodMessageRecv;
|
25
|
+
# uint64 uniqueFetchMessageRecv;
|
26
|
+
# uint64 duplicateFetchMessageRecv;
|
27
|
+
# };
|
28
|
+
#
|
29
|
+
# ===========================================================================
|
30
|
+
module Stellar
|
31
|
+
class PeerStats < XDR::Struct
|
32
|
+
attribute :id, NodeID
|
33
|
+
attribute :version_str, XDR::String[100]
|
34
|
+
attribute :messages_read, Uint64
|
35
|
+
attribute :messages_written, Uint64
|
36
|
+
attribute :bytes_read, Uint64
|
37
|
+
attribute :bytes_written, Uint64
|
38
|
+
attribute :seconds_connected, Uint64
|
39
|
+
attribute :unique_flood_bytes_recv, Uint64
|
40
|
+
attribute :duplicate_flood_bytes_recv, Uint64
|
41
|
+
attribute :unique_fetch_bytes_recv, Uint64
|
42
|
+
attribute :duplicate_fetch_bytes_recv, Uint64
|
43
|
+
attribute :unique_flood_message_recv, Uint64
|
44
|
+
attribute :duplicate_flood_message_recv, Uint64
|
45
|
+
attribute :unique_fetch_message_recv, Uint64
|
46
|
+
attribute :duplicate_fetch_message_recv, Uint64
|
47
|
+
end
|
48
|
+
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 SignedSurveyRequestMessage
|
9
|
+
# {
|
10
|
+
# Signature requestSignature;
|
11
|
+
# SurveyRequestMessage request;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class SignedSurveyRequestMessage < XDR::Struct
|
17
|
+
attribute :request_signature, Signature
|
18
|
+
attribute :request, SurveyRequestMessage
|
19
|
+
end
|
20
|
+
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 SignedSurveyResponseMessage
|
9
|
+
# {
|
10
|
+
# Signature responseSignature;
|
11
|
+
# SurveyResponseMessage response;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class SignedSurveyResponseMessage < XDR::Struct
|
17
|
+
attribute :response_signature, Signature
|
18
|
+
attribute :response, SurveyResponseMessage
|
19
|
+
end
|
20
|
+
end
|
data/generated/stellar/signer.rb
CHANGED
@@ -28,6 +28,12 @@ require 'xdr'
|
|
28
28
|
# case TRANSACTION:
|
29
29
|
# TransactionEnvelope transaction;
|
30
30
|
#
|
31
|
+
# case SURVEY_REQUEST:
|
32
|
+
# SignedSurveyRequestMessage signedSurveyRequestMessage;
|
33
|
+
#
|
34
|
+
# case SURVEY_RESPONSE:
|
35
|
+
# SignedSurveyResponseMessage signedSurveyResponseMessage;
|
36
|
+
#
|
31
37
|
# // SCP
|
32
38
|
# case GET_SCP_QUORUMSET:
|
33
39
|
# uint256 qSetHash;
|
@@ -53,22 +59,26 @@ module Stellar
|
|
53
59
|
switch :get_tx_set, :tx_set_hash
|
54
60
|
switch :tx_set, :tx_set
|
55
61
|
switch :transaction, :transaction
|
62
|
+
switch :survey_request, :signed_survey_request_message
|
63
|
+
switch :survey_response, :signed_survey_response_message
|
56
64
|
switch :get_scp_quorumset, :q_set_hash
|
57
65
|
switch :scp_quorumset, :q_set
|
58
66
|
switch :scp_message, :envelope
|
59
67
|
switch :get_scp_state, :get_scp_ledger_seq
|
60
68
|
|
61
|
-
attribute :error,
|
62
|
-
attribute :hello,
|
63
|
-
attribute :auth,
|
64
|
-
attribute :dont_have,
|
65
|
-
attribute :peers,
|
66
|
-
attribute :tx_set_hash,
|
67
|
-
attribute :tx_set,
|
68
|
-
attribute :transaction,
|
69
|
-
attribute :
|
70
|
-
attribute :
|
71
|
-
attribute :
|
72
|
-
attribute :
|
69
|
+
attribute :error, Error
|
70
|
+
attribute :hello, Hello
|
71
|
+
attribute :auth, Auth
|
72
|
+
attribute :dont_have, DontHave
|
73
|
+
attribute :peers, XDR::VarArray[PeerAddress, 100]
|
74
|
+
attribute :tx_set_hash, Uint256
|
75
|
+
attribute :tx_set, TransactionSet
|
76
|
+
attribute :transaction, TransactionEnvelope
|
77
|
+
attribute :signed_survey_request_message, SignedSurveyRequestMessage
|
78
|
+
attribute :signed_survey_response_message, SignedSurveyResponseMessage
|
79
|
+
attribute :q_set_hash, Uint256
|
80
|
+
attribute :q_set, SCPQuorumSet
|
81
|
+
attribute :envelope, SCPEnvelope
|
82
|
+
attribute :get_scp_ledger_seq, Uint32
|
73
83
|
end
|
74
84
|
end
|
@@ -7,8 +7,8 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct StellarValue
|
9
9
|
# {
|
10
|
-
# Hash txSetHash;
|
11
|
-
#
|
10
|
+
# Hash txSetHash; // transaction set to apply to previous ledger
|
11
|
+
# TimePoint closeTime; // network close time
|
12
12
|
#
|
13
13
|
# // upgrades to apply to the previous ledger (usually empty)
|
14
14
|
# // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop
|
@@ -18,10 +18,12 @@ require 'xdr'
|
|
18
18
|
# UpgradeType upgrades<6>;
|
19
19
|
#
|
20
20
|
# // reserved for future use
|
21
|
-
# union switch (
|
21
|
+
# union switch (StellarValueType v)
|
22
22
|
# {
|
23
|
-
# case
|
23
|
+
# case STELLAR_VALUE_BASIC:
|
24
24
|
# void;
|
25
|
+
# case STELLAR_VALUE_SIGNED:
|
26
|
+
# LedgerCloseValueSignature lcValueSignature;
|
25
27
|
# }
|
26
28
|
# ext;
|
27
29
|
# };
|
@@ -34,7 +36,7 @@ module Stellar
|
|
34
36
|
autoload :Ext
|
35
37
|
|
36
38
|
attribute :tx_set_hash, Hash
|
37
|
-
attribute :close_time,
|
39
|
+
attribute :close_time, TimePoint
|
38
40
|
attribute :upgrades, XDR::VarArray[UpgradeType, 6]
|
39
41
|
attribute :ext, Ext
|
40
42
|
end
|
@@ -5,20 +5,24 @@ require 'xdr'
|
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
# union switch (
|
8
|
+
# union switch (StellarValueType v)
|
9
9
|
# {
|
10
|
-
# case
|
10
|
+
# case STELLAR_VALUE_BASIC:
|
11
11
|
# void;
|
12
|
+
# case STELLAR_VALUE_SIGNED:
|
13
|
+
# LedgerCloseValueSignature lcValueSignature;
|
12
14
|
# }
|
13
15
|
#
|
14
16
|
# ===========================================================================
|
15
17
|
module Stellar
|
16
18
|
class StellarValue
|
17
19
|
class Ext < XDR::Union
|
18
|
-
switch_on
|
20
|
+
switch_on StellarValueType, :v
|
19
21
|
|
20
|
-
switch
|
22
|
+
switch :stellar_value_basic
|
23
|
+
switch :stellar_value_signed, :lc_value_signature
|
21
24
|
|
25
|
+
attribute :lc_value_signature, LedgerCloseValueSignature
|
22
26
|
end
|
23
27
|
end
|
24
28
|
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
|
+
# enum StellarValueType
|
9
|
+
# {
|
10
|
+
# STELLAR_VALUE_BASIC = 0,
|
11
|
+
# STELLAR_VALUE_SIGNED = 1
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class StellarValueType < XDR::Enum
|
17
|
+
member :stellar_value_basic, 0
|
18
|
+
member :stellar_value_signed, 1
|
19
|
+
|
20
|
+
seal
|
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
|
+
# enum SurveyMessageCommandType
|
9
|
+
# {
|
10
|
+
# SURVEY_TOPOLOGY = 0
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class SurveyMessageCommandType < XDR::Enum
|
16
|
+
member :survey_topology, 0
|
17
|
+
|
18
|
+
seal
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,26 @@
|
|
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 SurveyRequestMessage
|
9
|
+
# {
|
10
|
+
# NodeID surveyorPeerID;
|
11
|
+
# NodeID surveyedPeerID;
|
12
|
+
# uint32 ledgerNum;
|
13
|
+
# Curve25519Public encryptionKey;
|
14
|
+
# SurveyMessageCommandType commandType;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class SurveyRequestMessage < XDR::Struct
|
20
|
+
attribute :surveyor_peer_id, NodeID
|
21
|
+
attribute :surveyed_peer_id, NodeID
|
22
|
+
attribute :ledger_num, Uint32
|
23
|
+
attribute :encryption_key, Curve25519Public
|
24
|
+
attribute :command_type, SurveyMessageCommandType
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
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 SurveyResponseBody switch (SurveyMessageCommandType type)
|
9
|
+
# {
|
10
|
+
# case SURVEY_TOPOLOGY:
|
11
|
+
# TopologyResponseBody topologyResponseBody;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class SurveyResponseBody < XDR::Union
|
17
|
+
switch_on SurveyMessageCommandType, :type
|
18
|
+
|
19
|
+
switch :survey_topology, :topology_response_body
|
20
|
+
|
21
|
+
attribute :topology_response_body, TopologyResponseBody
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
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 SurveyResponseMessage
|
9
|
+
# {
|
10
|
+
# NodeID surveyorPeerID;
|
11
|
+
# NodeID surveyedPeerID;
|
12
|
+
# uint32 ledgerNum;
|
13
|
+
# SurveyMessageCommandType commandType;
|
14
|
+
# EncryptedBody encryptedBody;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class SurveyResponseMessage < XDR::Struct
|
20
|
+
attribute :surveyor_peer_id, NodeID
|
21
|
+
attribute :surveyed_peer_id, NodeID
|
22
|
+
attribute :ledger_num, Uint32
|
23
|
+
attribute :command_type, SurveyMessageCommandType
|
24
|
+
attribute :encrypted_body, EncryptedBody
|
25
|
+
end
|
26
|
+
end
|
@@ -7,14 +7,14 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct TimeBounds
|
9
9
|
# {
|
10
|
-
#
|
11
|
-
#
|
10
|
+
# TimePoint minTime;
|
11
|
+
# TimePoint maxTime; // 0 here means no maxTime
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
16
|
class TimeBounds < XDR::Struct
|
17
|
-
attribute :min_time,
|
18
|
-
attribute :max_time,
|
17
|
+
attribute :min_time, TimePoint
|
18
|
+
attribute :max_time, TimePoint
|
19
19
|
end
|
20
20
|
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
|
+
# struct TopologyResponseBody
|
9
|
+
# {
|
10
|
+
# PeerStatList inboundPeers;
|
11
|
+
# PeerStatList outboundPeers;
|
12
|
+
#
|
13
|
+
# uint32 totalInboundPeerCount;
|
14
|
+
# uint32 totalOutboundPeerCount;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class TopologyResponseBody < XDR::Struct
|
20
|
+
attribute :inbound_peers, PeerStatList
|
21
|
+
attribute :outbound_peers, PeerStatList
|
22
|
+
attribute :total_inbound_peer_count, Uint32
|
23
|
+
attribute :total_outbound_peer_count, Uint32
|
24
|
+
end
|
25
|
+
end
|
@@ -8,7 +8,7 @@ require 'xdr'
|
|
8
8
|
# struct Transaction
|
9
9
|
# {
|
10
10
|
# // account used to run the transaction
|
11
|
-
#
|
11
|
+
# MuxedAccount sourceAccount;
|
12
12
|
#
|
13
13
|
# // the fee the sourceAccount will pay
|
14
14
|
# uint32 fee;
|
@@ -21,7 +21,7 @@ require 'xdr'
|
|
21
21
|
#
|
22
22
|
# Memo memo;
|
23
23
|
#
|
24
|
-
# Operation operations<
|
24
|
+
# Operation operations<MAX_OPS_PER_TX>;
|
25
25
|
#
|
26
26
|
# // reserved for future use
|
27
27
|
# union switch (int v)
|
@@ -39,12 +39,12 @@ module Stellar
|
|
39
39
|
|
40
40
|
autoload :Ext
|
41
41
|
|
42
|
-
attribute :source_account,
|
42
|
+
attribute :source_account, MuxedAccount
|
43
43
|
attribute :fee, Uint32
|
44
44
|
attribute :seq_num, SequenceNumber
|
45
45
|
attribute :time_bounds, XDR::Option[TimeBounds]
|
46
46
|
attribute :memo, Memo
|
47
|
-
attribute :operations, XDR::VarArray[Operation,
|
47
|
+
attribute :operations, XDR::VarArray[Operation, MAX_OPS_PER_TX]
|
48
48
|
attribute :ext, Ext
|
49
49
|
end
|
50
50
|
end
|
@@ -5,18 +5,27 @@ require 'xdr'
|
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
#
|
8
|
+
# union TransactionEnvelope switch (EnvelopeType type)
|
9
9
|
# {
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
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::
|
19
|
-
|
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
|