open-core 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.travis.yml +15 -0
- data/.yardopts +8 -0
- data/CONTRIBUTING.md +48 -0
- data/Gemfile +15 -0
- data/Guardfile +5 -0
- data/LICENSE.txt +202 -0
- data/README.md +83 -0
- data/Rakefile +4 -0
- data/examples/create_account.rb +26 -0
- data/examples/low_level_transaction_post.rb +46 -0
- data/examples/mid_level_transaction_post.rb +33 -0
- data/examples/non_native_payment.rb +60 -0
- data/examples/offer.rb +75 -0
- data/examples/transaction_merge.rb +23 -0
- data/generated/stellar-base-generated.rb +134 -0
- data/generated/stellar/account_entry.rb +53 -0
- data/generated/stellar/account_entry/ext.rb +24 -0
- data/generated/stellar/account_flags.rb +27 -0
- data/generated/stellar/account_merge_result.rb +26 -0
- data/generated/stellar/account_merge_result_code.rb +30 -0
- data/generated/stellar/allow_trust_op.rb +38 -0
- data/generated/stellar/allow_trust_op/asset.rb +33 -0
- data/generated/stellar/allow_trust_result.rb +25 -0
- data/generated/stellar/allow_trust_result_code.rb +31 -0
- data/generated/stellar/asset.rb +47 -0
- data/generated/stellar/asset/alpha_num12.rb +22 -0
- data/generated/stellar/asset/alpha_num4.rb +22 -0
- data/generated/stellar/asset_type.rb +24 -0
- data/generated/stellar/bucket_entry.rb +28 -0
- data/generated/stellar/bucket_entry_type.rb +22 -0
- data/generated/stellar/change_trust_op.rb +22 -0
- data/generated/stellar/change_trust_result.rb +25 -0
- data/generated/stellar/change_trust_result_code.rb +30 -0
- data/generated/stellar/claim_offer_atom.rb +33 -0
- data/generated/stellar/create_account_op.rb +20 -0
- data/generated/stellar/create_account_result.rb +25 -0
- data/generated/stellar/create_account_result_code.rb +32 -0
- data/generated/stellar/create_passive_offer_op.rb +24 -0
- data/generated/stellar/crypto_key_type.rb +20 -0
- data/generated/stellar/decorated_signature.rb +20 -0
- data/generated/stellar/dont_have.rb +20 -0
- data/generated/stellar/envelope_type.rb +22 -0
- data/generated/stellar/error.rb +20 -0
- data/generated/stellar/hello.rb +26 -0
- data/generated/stellar/inflation_payout.rb +20 -0
- data/generated/stellar/inflation_result.rb +26 -0
- data/generated/stellar/inflation_result_code.rb +24 -0
- data/generated/stellar/ledger_entry.rb +44 -0
- data/generated/stellar/ledger_entry/data.rb +33 -0
- data/generated/stellar/ledger_entry/ext.rb +24 -0
- data/generated/stellar/ledger_entry_change.rb +31 -0
- data/generated/stellar/ledger_entry_change_type.rb +24 -0
- data/generated/stellar/ledger_entry_type.rb +24 -0
- data/generated/stellar/ledger_header.rb +65 -0
- data/generated/stellar/ledger_header/ext.rb +24 -0
- data/generated/stellar/ledger_header_history_entry.rb +33 -0
- data/generated/stellar/ledger_header_history_entry/ext.rb +24 -0
- data/generated/stellar/ledger_key.rb +50 -0
- data/generated/stellar/ledger_key/account.rb +20 -0
- data/generated/stellar/ledger_key/offer.rb +22 -0
- data/generated/stellar/ledger_key/trust_line.rb +22 -0
- data/generated/stellar/ledger_upgrade.rb +27 -0
- data/generated/stellar/ledger_upgrade_type.rb +22 -0
- data/generated/stellar/manage_offer_effect.rb +24 -0
- data/generated/stellar/manage_offer_op.rb +28 -0
- data/generated/stellar/manage_offer_result.rb +26 -0
- data/generated/stellar/manage_offer_result_code.rb +48 -0
- data/generated/stellar/manage_offer_success_result.rb +34 -0
- data/generated/stellar/manage_offer_success_result/offer.rb +30 -0
- data/generated/stellar/memo.rb +38 -0
- data/generated/stellar/memo_type.rb +28 -0
- data/generated/stellar/message_type.rb +45 -0
- data/generated/stellar/offer_entry.rb +49 -0
- data/generated/stellar/offer_entry/ext.rb +24 -0
- data/generated/stellar/offer_entry_flags.rb +21 -0
- data/generated/stellar/operation.rb +51 -0
- data/generated/stellar/operation/body.rb +60 -0
- data/generated/stellar/operation_meta.rb +18 -0
- data/generated/stellar/operation_result.rb +53 -0
- data/generated/stellar/operation_result/tr.rb +61 -0
- data/generated/stellar/operation_result_code.rb +25 -0
- data/generated/stellar/operation_type.rb +38 -0
- data/generated/stellar/path_payment_op.rb +32 -0
- data/generated/stellar/path_payment_result.rb +34 -0
- data/generated/stellar/path_payment_result/success.rb +22 -0
- data/generated/stellar/path_payment_result_code.rb +45 -0
- data/generated/stellar/payment_op.rb +22 -0
- data/generated/stellar/payment_result.rb +25 -0
- data/generated/stellar/payment_result_code.rb +39 -0
- data/generated/stellar/peer_address.rb +22 -0
- data/generated/stellar/price.rb +20 -0
- data/generated/stellar/public_key.rb +23 -0
- data/generated/stellar/scp_ballot.rb +20 -0
- data/generated/stellar/scp_envelope.rb +20 -0
- data/generated/stellar/scp_nomination.rb +22 -0
- data/generated/stellar/scp_quorum_set.rb +22 -0
- data/generated/stellar/scp_statement.rb +59 -0
- data/generated/stellar/scp_statement/pledges.rb +64 -0
- data/generated/stellar/scp_statement/pledges/confirm.rb +28 -0
- data/generated/stellar/scp_statement/pledges/externalize.rb +28 -0
- data/generated/stellar/scp_statement/pledges/prepare.rb +32 -0
- data/generated/stellar/scp_statement_type.rb +26 -0
- data/generated/stellar/set_options_op.rb +41 -0
- data/generated/stellar/set_options_result.rb +25 -0
- data/generated/stellar/set_options_result_code.rb +38 -0
- data/generated/stellar/signer.rb +20 -0
- data/generated/stellar/simple_payment_result.rb +22 -0
- data/generated/stellar/stellar_message.rb +66 -0
- data/generated/stellar/stellar_value.rb +40 -0
- data/generated/stellar/stellar_value/ext.rb +24 -0
- data/generated/stellar/threshold_indexes.rb +26 -0
- data/generated/stellar/time_bounds.rb +20 -0
- data/generated/stellar/transaction.rb +50 -0
- data/generated/stellar/transaction/ext.rb +24 -0
- data/generated/stellar/transaction_envelope.rb +20 -0
- data/generated/stellar/transaction_history_entry.rb +33 -0
- data/generated/stellar/transaction_history_entry/ext.rb +24 -0
- data/generated/stellar/transaction_history_result_entry.rb +33 -0
- data/generated/stellar/transaction_history_result_entry/ext.rb +24 -0
- data/generated/stellar/transaction_meta.rb +31 -0
- data/generated/stellar/transaction_meta/v0.rb +22 -0
- data/generated/stellar/transaction_result.rb +43 -0
- data/generated/stellar/transaction_result/ext.rb +24 -0
- data/generated/stellar/transaction_result/result.rb +30 -0
- data/generated/stellar/transaction_result_code.rb +45 -0
- data/generated/stellar/transaction_result_pair.rb +20 -0
- data/generated/stellar/transaction_result_set.rb +18 -0
- data/generated/stellar/transaction_set.rb +20 -0
- data/generated/stellar/trust_line_entry.rb +41 -0
- data/generated/stellar/trust_line_entry/ext.rb +24 -0
- data/generated/stellar/trust_line_flags.rb +21 -0
- data/lib/stellar-base.rb +32 -0
- data/lib/stellar/account_flags.rb +28 -0
- data/lib/stellar/asset.rb +69 -0
- data/lib/stellar/base.rb +1 -0
- data/lib/stellar/base/version.rb +5 -0
- data/lib/stellar/convert.rb +32 -0
- data/lib/stellar/key_pair.rb +112 -0
- data/lib/stellar/networks.rb +45 -0
- data/lib/stellar/operation.rb +304 -0
- data/lib/stellar/path_payment_result.rb +17 -0
- data/lib/stellar/price.rb +32 -0
- data/lib/stellar/thresholds.rb +39 -0
- data/lib/stellar/transaction.rb +170 -0
- data/lib/stellar/transaction_envelope.rb +32 -0
- data/lib/stellar/util/continued_fraction.rb +96 -0
- data/lib/stellar/util/strkey.rb +43 -0
- data/open-core.gemspec +37 -0
- data/spec/lib/stellar/account_flags_spec.rb +19 -0
- data/spec/lib/stellar/asset_spec.rb +45 -0
- data/spec/lib/stellar/convert_spec.rb +61 -0
- data/spec/lib/stellar/key_pair_spec.rb +238 -0
- data/spec/lib/stellar/networks_spec.rb +77 -0
- data/spec/lib/stellar/path_payment_result_spec.rb +95 -0
- data/spec/lib/stellar/price_spec.rb +34 -0
- data/spec/lib/stellar/thresholds_spec.rb +62 -0
- data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
- data/spec/lib/stellar/transaction_spec.rb +54 -0
- data/spec/lib/stellar/util/strkey_spec.rb +46 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/matchers/be_strkey.rb +9 -0
- data/spec/support/matchers/eq_bytes.rb +5 -0
- data/spec/support/matchers/have_length.rb +5 -0
- data/tasks/rspec.rake +6 -0
- data/tasks/travis.rake +1 -0
- data/tasks/xdr.rake +50 -0
- data/xdr/Stellar-SCP.x +87 -0
- data/xdr/Stellar-ledger-entries.x +222 -0
- data/xdr/Stellar-ledger.x +231 -0
- data/xdr/Stellar-overlay.x +87 -0
- data/xdr/Stellar-transaction.x +670 -0
- data/xdr/Stellar-types.x +34 -0
- metadata +444 -0
@@ -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 CreateAccountOp
|
9
|
+
# {
|
10
|
+
# AccountID destination; // account to create
|
11
|
+
# int64 startingBalance; // amount they end up with
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class CreateAccountOp < XDR::Struct
|
17
|
+
attribute :destination, AccountID
|
18
|
+
attribute :starting_balance, Int64
|
19
|
+
end
|
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
|
+
# union CreateAccountResult switch (CreateAccountResultCode code)
|
9
|
+
# {
|
10
|
+
# case CREATE_ACCOUNT_SUCCESS:
|
11
|
+
# void;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class CreateAccountResult < XDR::Union
|
19
|
+
switch_on CreateAccountResultCode, :code
|
20
|
+
|
21
|
+
switch :create_account_success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
end
|
25
|
+
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
|
+
# enum CreateAccountResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# CREATE_ACCOUNT_SUCCESS = 0, // account was created
|
12
|
+
#
|
13
|
+
# // codes considered as "failure" for the operation
|
14
|
+
# CREATE_ACCOUNT_MALFORMED = -1, // invalid destination
|
15
|
+
# CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account
|
16
|
+
# CREATE_ACCOUNT_LOW_RESERVE =
|
17
|
+
# -3, // would create an account below the min reserve
|
18
|
+
# CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists
|
19
|
+
# };
|
20
|
+
#
|
21
|
+
# ===========================================================================
|
22
|
+
module Stellar
|
23
|
+
class CreateAccountResultCode < XDR::Enum
|
24
|
+
member :create_account_success, 0
|
25
|
+
member :create_account_malformed, -1
|
26
|
+
member :create_account_underfunded, -2
|
27
|
+
member :create_account_low_reserve, -3
|
28
|
+
member :create_account_already_exist, -4
|
29
|
+
|
30
|
+
seal
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
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 CreatePassiveOfferOp
|
9
|
+
# {
|
10
|
+
# Asset selling; // A
|
11
|
+
# Asset buying; // B
|
12
|
+
# int64 amount; // amount taker gets. if set to 0, delete the offer
|
13
|
+
# Price price; // cost of A in terms of B
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class CreatePassiveOfferOp < XDR::Struct
|
19
|
+
attribute :selling, Asset
|
20
|
+
attribute :buying, Asset
|
21
|
+
attribute :amount, Int64
|
22
|
+
attribute :price, Price
|
23
|
+
end
|
24
|
+
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 CryptoKeyType
|
9
|
+
# {
|
10
|
+
# KEY_TYPE_ED25519 = 0
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class CryptoKeyType < XDR::Enum
|
16
|
+
member :key_type_ed25519, 0
|
17
|
+
|
18
|
+
seal
|
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 DecoratedSignature
|
9
|
+
# {
|
10
|
+
# SignatureHint hint; // first 4 bytes of the public key, used as a hint
|
11
|
+
# Signature signature; // actual signature
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class DecoratedSignature < XDR::Struct
|
17
|
+
attribute :hint, SignatureHint
|
18
|
+
attribute :signature, Signature
|
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 DontHave
|
9
|
+
# {
|
10
|
+
# MessageType type;
|
11
|
+
# uint256 reqHash;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class DontHave < XDR::Struct
|
17
|
+
attribute :type, MessageType
|
18
|
+
attribute :req_hash, Uint256
|
19
|
+
end
|
20
|
+
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 EnvelopeType
|
9
|
+
# {
|
10
|
+
# ENVELOPE_TYPE_SCP = 1,
|
11
|
+
# ENVELOPE_TYPE_TX = 2
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class EnvelopeType < XDR::Enum
|
17
|
+
member :envelope_type_scp, 1
|
18
|
+
member :envelope_type_tx, 2
|
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
|
+
# struct Error
|
9
|
+
# {
|
10
|
+
# int code;
|
11
|
+
# string msg<100>;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class Error < XDR::Struct
|
17
|
+
attribute :code, XDR::Int
|
18
|
+
attribute :msg, XDR::String[100]
|
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 Hello
|
9
|
+
# {
|
10
|
+
# uint32 ledgerVersion;
|
11
|
+
# uint32 overlayVersion;
|
12
|
+
# string versionStr<100>;
|
13
|
+
# int listeningPort;
|
14
|
+
# NodeID peerID;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class Hello < XDR::Struct
|
20
|
+
attribute :ledger_version, Uint32
|
21
|
+
attribute :overlay_version, Uint32
|
22
|
+
attribute :version_str, XDR::String[100]
|
23
|
+
attribute :listening_port, XDR::Int
|
24
|
+
attribute :peer_id, NodeID
|
25
|
+
end
|
26
|
+
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 InflationPayout // or use PaymentResultAtom to limit types?
|
9
|
+
# {
|
10
|
+
# AccountID destination;
|
11
|
+
# int64 amount;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class InflationPayout < XDR::Struct
|
17
|
+
attribute :destination, AccountID
|
18
|
+
attribute :amount, Int64
|
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
|
+
# union InflationResult switch (InflationResultCode code)
|
9
|
+
# {
|
10
|
+
# case INFLATION_SUCCESS:
|
11
|
+
# InflationPayout payouts<>;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class InflationResult < XDR::Union
|
19
|
+
switch_on InflationResultCode, :code
|
20
|
+
|
21
|
+
switch :inflation_success, :payouts
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
attribute :payouts, XDR::VarArray[InflationPayout]
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
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 InflationResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# INFLATION_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# INFLATION_NOT_TIME = -1
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class InflationResultCode < XDR::Enum
|
19
|
+
member :inflation_success, 0
|
20
|
+
member :inflation_not_time, -1
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,44 @@
|
|
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 LedgerEntry
|
9
|
+
# {
|
10
|
+
# uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed
|
11
|
+
#
|
12
|
+
# union switch (LedgerEntryType type)
|
13
|
+
# {
|
14
|
+
# case ACCOUNT:
|
15
|
+
# AccountEntry account;
|
16
|
+
# case TRUSTLINE:
|
17
|
+
# TrustLineEntry trustLine;
|
18
|
+
# case OFFER:
|
19
|
+
# OfferEntry offer;
|
20
|
+
# }
|
21
|
+
# data;
|
22
|
+
#
|
23
|
+
# // reserved for future use
|
24
|
+
# union switch (int v)
|
25
|
+
# {
|
26
|
+
# case 0:
|
27
|
+
# void;
|
28
|
+
# }
|
29
|
+
# ext;
|
30
|
+
# };
|
31
|
+
#
|
32
|
+
# ===========================================================================
|
33
|
+
module Stellar
|
34
|
+
class LedgerEntry < XDR::Struct
|
35
|
+
include XDR::Namespace
|
36
|
+
|
37
|
+
autoload :Data
|
38
|
+
autoload :Ext
|
39
|
+
|
40
|
+
attribute :last_modified_ledger_seq, Uint32
|
41
|
+
attribute :data, Data
|
42
|
+
attribute :ext, Ext
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,33 @@
|
|
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 (LedgerEntryType type)
|
9
|
+
# {
|
10
|
+
# case ACCOUNT:
|
11
|
+
# AccountEntry account;
|
12
|
+
# case TRUSTLINE:
|
13
|
+
# TrustLineEntry trustLine;
|
14
|
+
# case OFFER:
|
15
|
+
# OfferEntry offer;
|
16
|
+
# }
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class LedgerEntry
|
21
|
+
class Data < XDR::Union
|
22
|
+
switch_on LedgerEntryType, :type
|
23
|
+
|
24
|
+
switch :account, :account
|
25
|
+
switch :trustline, :trust_line
|
26
|
+
switch :offer, :offer
|
27
|
+
|
28
|
+
attribute :account, AccountEntry
|
29
|
+
attribute :trust_line, TrustLineEntry
|
30
|
+
attribute :offer, OfferEntry
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
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 (int v)
|
9
|
+
# {
|
10
|
+
# case 0:
|
11
|
+
# void;
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class LedgerEntry
|
17
|
+
class Ext < XDR::Union
|
18
|
+
switch_on XDR::Int, :v
|
19
|
+
|
20
|
+
switch 0
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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 LedgerEntryChange switch (LedgerEntryChangeType type)
|
9
|
+
# {
|
10
|
+
# case LEDGER_ENTRY_CREATED:
|
11
|
+
# LedgerEntry created;
|
12
|
+
# case LEDGER_ENTRY_UPDATED:
|
13
|
+
# LedgerEntry updated;
|
14
|
+
# case LEDGER_ENTRY_REMOVED:
|
15
|
+
# LedgerKey removed;
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class LedgerEntryChange < XDR::Union
|
21
|
+
switch_on LedgerEntryChangeType, :type
|
22
|
+
|
23
|
+
switch :ledger_entry_created, :created
|
24
|
+
switch :ledger_entry_updated, :updated
|
25
|
+
switch :ledger_entry_removed, :removed
|
26
|
+
|
27
|
+
attribute :created, LedgerEntry
|
28
|
+
attribute :updated, LedgerEntry
|
29
|
+
attribute :removed, LedgerKey
|
30
|
+
end
|
31
|
+
end
|