open-core 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,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
|
+
# enum ManageOfferResultCode
|
|
9
|
+
# {
|
|
10
|
+
# // codes considered as "success" for the operation
|
|
11
|
+
# MANAGE_OFFER_SUCCESS = 0,
|
|
12
|
+
#
|
|
13
|
+
# // codes considered as "failure" for the operation
|
|
14
|
+
# MANAGE_OFFER_MALFORMED = -1, // generated offer would be invalid
|
|
15
|
+
# MANAGE_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling
|
|
16
|
+
# MANAGE_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
|
|
17
|
+
# MANAGE_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
|
|
18
|
+
# MANAGE_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
|
|
19
|
+
# MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
|
|
20
|
+
# MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
|
|
21
|
+
# MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
|
|
22
|
+
#
|
|
23
|
+
# // update errors
|
|
24
|
+
# MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
|
|
25
|
+
# MANAGE_OFFER_MISMATCH = -10, // currencies don't match offer
|
|
26
|
+
#
|
|
27
|
+
# MANAGE_OFFER_LOW_RESERVE = -11 // not enough funds to create a new Offer
|
|
28
|
+
# };
|
|
29
|
+
#
|
|
30
|
+
# ===========================================================================
|
|
31
|
+
module Stellar
|
|
32
|
+
class ManageOfferResultCode < XDR::Enum
|
|
33
|
+
member :manage_offer_success, 0
|
|
34
|
+
member :manage_offer_malformed, -1
|
|
35
|
+
member :manage_offer_sell_no_trust, -2
|
|
36
|
+
member :manage_offer_buy_no_trust, -3
|
|
37
|
+
member :manage_offer_sell_not_authorized, -4
|
|
38
|
+
member :manage_offer_buy_not_authorized, -5
|
|
39
|
+
member :manage_offer_line_full, -6
|
|
40
|
+
member :manage_offer_underfunded, -7
|
|
41
|
+
member :manage_offer_cross_self, -8
|
|
42
|
+
member :manage_offer_not_found, -9
|
|
43
|
+
member :manage_offer_mismatch, -10
|
|
44
|
+
member :manage_offer_low_reserve, -11
|
|
45
|
+
|
|
46
|
+
seal
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This code was automatically generated using xdrgen
|
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
|
3
|
+
|
|
4
|
+
require 'xdr'
|
|
5
|
+
|
|
6
|
+
# === xdr source ============================================================
|
|
7
|
+
#
|
|
8
|
+
# struct ManageOfferSuccessResult
|
|
9
|
+
# {
|
|
10
|
+
# // offers that got claimed while creating this offer
|
|
11
|
+
# ClaimOfferAtom offersClaimed<>;
|
|
12
|
+
#
|
|
13
|
+
# union switch (ManageOfferEffect effect)
|
|
14
|
+
# {
|
|
15
|
+
# case MANAGE_OFFER_CREATED:
|
|
16
|
+
# case MANAGE_OFFER_UPDATED:
|
|
17
|
+
# OfferEntry offer;
|
|
18
|
+
# default:
|
|
19
|
+
# void;
|
|
20
|
+
# }
|
|
21
|
+
# offer;
|
|
22
|
+
# };
|
|
23
|
+
#
|
|
24
|
+
# ===========================================================================
|
|
25
|
+
module Stellar
|
|
26
|
+
class ManageOfferSuccessResult < XDR::Struct
|
|
27
|
+
include XDR::Namespace
|
|
28
|
+
|
|
29
|
+
autoload :Offer
|
|
30
|
+
|
|
31
|
+
attribute :offers_claimed, XDR::VarArray[ClaimOfferAtom]
|
|
32
|
+
attribute :offer, Offer
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
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 (ManageOfferEffect effect)
|
|
9
|
+
# {
|
|
10
|
+
# case MANAGE_OFFER_CREATED:
|
|
11
|
+
# case MANAGE_OFFER_UPDATED:
|
|
12
|
+
# OfferEntry offer;
|
|
13
|
+
# default:
|
|
14
|
+
# void;
|
|
15
|
+
# }
|
|
16
|
+
#
|
|
17
|
+
# ===========================================================================
|
|
18
|
+
module Stellar
|
|
19
|
+
class ManageOfferSuccessResult
|
|
20
|
+
class Offer < XDR::Union
|
|
21
|
+
switch_on ManageOfferEffect, :effect
|
|
22
|
+
|
|
23
|
+
switch :manage_offer_created, :offer
|
|
24
|
+
switch :manage_offer_updated, :offer
|
|
25
|
+
switch :default
|
|
26
|
+
|
|
27
|
+
attribute :offer, OfferEntry
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# This code was automatically generated using xdrgen
|
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
|
3
|
+
|
|
4
|
+
require 'xdr'
|
|
5
|
+
|
|
6
|
+
# === xdr source ============================================================
|
|
7
|
+
#
|
|
8
|
+
# union Memo switch (MemoType type)
|
|
9
|
+
# {
|
|
10
|
+
# case MEMO_NONE:
|
|
11
|
+
# void;
|
|
12
|
+
# case MEMO_TEXT:
|
|
13
|
+
# string text<28>;
|
|
14
|
+
# case MEMO_ID:
|
|
15
|
+
# uint64 id;
|
|
16
|
+
# case MEMO_HASH:
|
|
17
|
+
# Hash hash; // the hash of what to pull from the content server
|
|
18
|
+
# case MEMO_RETURN:
|
|
19
|
+
# Hash retHash; // the hash of the tx you are rejecting
|
|
20
|
+
# };
|
|
21
|
+
#
|
|
22
|
+
# ===========================================================================
|
|
23
|
+
module Stellar
|
|
24
|
+
class Memo < XDR::Union
|
|
25
|
+
switch_on MemoType, :type
|
|
26
|
+
|
|
27
|
+
switch :memo_none
|
|
28
|
+
switch :memo_text, :text
|
|
29
|
+
switch :memo_id, :id
|
|
30
|
+
switch :memo_hash, :hash
|
|
31
|
+
switch :memo_return, :ret_hash
|
|
32
|
+
|
|
33
|
+
attribute :text, XDR::String[28]
|
|
34
|
+
attribute :id, Uint64
|
|
35
|
+
attribute :hash, Hash
|
|
36
|
+
attribute :ret_hash, Hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
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 MemoType
|
|
9
|
+
# {
|
|
10
|
+
# MEMO_NONE = 0,
|
|
11
|
+
# MEMO_TEXT = 1,
|
|
12
|
+
# MEMO_ID = 2,
|
|
13
|
+
# MEMO_HASH = 3,
|
|
14
|
+
# MEMO_RETURN = 4
|
|
15
|
+
# };
|
|
16
|
+
#
|
|
17
|
+
# ===========================================================================
|
|
18
|
+
module Stellar
|
|
19
|
+
class MemoType < XDR::Enum
|
|
20
|
+
member :memo_none, 0
|
|
21
|
+
member :memo_text, 1
|
|
22
|
+
member :memo_id, 2
|
|
23
|
+
member :memo_hash, 3
|
|
24
|
+
member :memo_return, 4
|
|
25
|
+
|
|
26
|
+
seal
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# This code was automatically generated using xdrgen
|
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
|
3
|
+
|
|
4
|
+
require 'xdr'
|
|
5
|
+
|
|
6
|
+
# === xdr source ============================================================
|
|
7
|
+
#
|
|
8
|
+
# enum MessageType
|
|
9
|
+
# {
|
|
10
|
+
# ERROR_MSG = 0,
|
|
11
|
+
# HELLO = 1,
|
|
12
|
+
# DONT_HAVE = 2,
|
|
13
|
+
#
|
|
14
|
+
# GET_PEERS = 3, // gets a list of peers this guy knows about
|
|
15
|
+
# PEERS = 4,
|
|
16
|
+
#
|
|
17
|
+
# GET_TX_SET = 5, // gets a particular txset by hash
|
|
18
|
+
# TX_SET = 6,
|
|
19
|
+
#
|
|
20
|
+
# TRANSACTION = 7, // pass on a tx you have heard about
|
|
21
|
+
#
|
|
22
|
+
# // SCP
|
|
23
|
+
# GET_SCP_QUORUMSET = 8,
|
|
24
|
+
# SCP_QUORUMSET = 9,
|
|
25
|
+
# SCP_MESSAGE = 10
|
|
26
|
+
# };
|
|
27
|
+
#
|
|
28
|
+
# ===========================================================================
|
|
29
|
+
module Stellar
|
|
30
|
+
class MessageType < XDR::Enum
|
|
31
|
+
member :error_msg, 0
|
|
32
|
+
member :hello, 1
|
|
33
|
+
member :dont_have, 2
|
|
34
|
+
member :get_peers, 3
|
|
35
|
+
member :peers, 4
|
|
36
|
+
member :get_tx_set, 5
|
|
37
|
+
member :tx_set, 6
|
|
38
|
+
member :transaction, 7
|
|
39
|
+
member :get_scp_quorumset, 8
|
|
40
|
+
member :scp_quorumset, 9
|
|
41
|
+
member :scp_message, 10
|
|
42
|
+
|
|
43
|
+
seal
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
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 OfferEntry
|
|
9
|
+
# {
|
|
10
|
+
# AccountID sellerID;
|
|
11
|
+
# uint64 offerID;
|
|
12
|
+
# Asset selling; // A
|
|
13
|
+
# Asset buying; // B
|
|
14
|
+
# int64 amount; // amount of A
|
|
15
|
+
#
|
|
16
|
+
# /* price for this offer:
|
|
17
|
+
# price of A in terms of B
|
|
18
|
+
# price=AmountB/AmountA=priceNumerator/priceDenominator
|
|
19
|
+
# price is after fees
|
|
20
|
+
# */
|
|
21
|
+
# Price price;
|
|
22
|
+
# uint32 flags; // see OfferEntryFlags
|
|
23
|
+
#
|
|
24
|
+
# // reserved for future use
|
|
25
|
+
# union switch (int v)
|
|
26
|
+
# {
|
|
27
|
+
# case 0:
|
|
28
|
+
# void;
|
|
29
|
+
# }
|
|
30
|
+
# ext;
|
|
31
|
+
# };
|
|
32
|
+
#
|
|
33
|
+
# ===========================================================================
|
|
34
|
+
module Stellar
|
|
35
|
+
class OfferEntry < XDR::Struct
|
|
36
|
+
include XDR::Namespace
|
|
37
|
+
|
|
38
|
+
autoload :Ext
|
|
39
|
+
|
|
40
|
+
attribute :seller_id, AccountID
|
|
41
|
+
attribute :offer_id, Uint64
|
|
42
|
+
attribute :selling, Asset
|
|
43
|
+
attribute :buying, Asset
|
|
44
|
+
attribute :amount, Int64
|
|
45
|
+
attribute :price, Price
|
|
46
|
+
attribute :flags, Uint32
|
|
47
|
+
attribute :ext, Ext
|
|
48
|
+
end
|
|
49
|
+
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 OfferEntry
|
|
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,21 @@
|
|
|
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 OfferEntryFlags
|
|
9
|
+
# {
|
|
10
|
+
# // issuer has authorized account to perform transactions with its credit
|
|
11
|
+
# PASSIVE_FLAG = 1
|
|
12
|
+
# };
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class OfferEntryFlags < XDR::Enum
|
|
17
|
+
member :passive_flag, 1
|
|
18
|
+
|
|
19
|
+
seal
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
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 Operation
|
|
9
|
+
# {
|
|
10
|
+
# // sourceAccount is the account used to run the operation
|
|
11
|
+
# // if not set, the runtime defaults to "sourceAccount" specified at
|
|
12
|
+
# // the transaction level
|
|
13
|
+
# AccountID* sourceAccount;
|
|
14
|
+
#
|
|
15
|
+
# union switch (OperationType type)
|
|
16
|
+
# {
|
|
17
|
+
# case CREATE_ACCOUNT:
|
|
18
|
+
# CreateAccountOp createAccountOp;
|
|
19
|
+
# case PAYMENT:
|
|
20
|
+
# PaymentOp paymentOp;
|
|
21
|
+
# case PATH_PAYMENT:
|
|
22
|
+
# PathPaymentOp pathPaymentOp;
|
|
23
|
+
# case MANAGE_OFFER:
|
|
24
|
+
# ManageOfferOp manageOfferOp;
|
|
25
|
+
# case CREATE_PASSIVE_OFFER:
|
|
26
|
+
# CreatePassiveOfferOp createPassiveOfferOp;
|
|
27
|
+
# case SET_OPTIONS:
|
|
28
|
+
# SetOptionsOp setOptionsOp;
|
|
29
|
+
# case CHANGE_TRUST:
|
|
30
|
+
# ChangeTrustOp changeTrustOp;
|
|
31
|
+
# case ALLOW_TRUST:
|
|
32
|
+
# AllowTrustOp allowTrustOp;
|
|
33
|
+
# case ACCOUNT_MERGE:
|
|
34
|
+
# AccountID destination;
|
|
35
|
+
# case INFLATION:
|
|
36
|
+
# void;
|
|
37
|
+
# }
|
|
38
|
+
# body;
|
|
39
|
+
# };
|
|
40
|
+
#
|
|
41
|
+
# ===========================================================================
|
|
42
|
+
module Stellar
|
|
43
|
+
class Operation < XDR::Struct
|
|
44
|
+
include XDR::Namespace
|
|
45
|
+
|
|
46
|
+
autoload :Body
|
|
47
|
+
|
|
48
|
+
attribute :source_account, XDR::Option[AccountID]
|
|
49
|
+
attribute :body, Body
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# This code was automatically generated using xdrgen
|
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
|
3
|
+
|
|
4
|
+
require 'xdr'
|
|
5
|
+
|
|
6
|
+
# === xdr source ============================================================
|
|
7
|
+
#
|
|
8
|
+
# union switch (OperationType type)
|
|
9
|
+
# {
|
|
10
|
+
# case CREATE_ACCOUNT:
|
|
11
|
+
# CreateAccountOp createAccountOp;
|
|
12
|
+
# case PAYMENT:
|
|
13
|
+
# PaymentOp paymentOp;
|
|
14
|
+
# case PATH_PAYMENT:
|
|
15
|
+
# PathPaymentOp pathPaymentOp;
|
|
16
|
+
# case MANAGE_OFFER:
|
|
17
|
+
# ManageOfferOp manageOfferOp;
|
|
18
|
+
# case CREATE_PASSIVE_OFFER:
|
|
19
|
+
# CreatePassiveOfferOp createPassiveOfferOp;
|
|
20
|
+
# case SET_OPTIONS:
|
|
21
|
+
# SetOptionsOp setOptionsOp;
|
|
22
|
+
# case CHANGE_TRUST:
|
|
23
|
+
# ChangeTrustOp changeTrustOp;
|
|
24
|
+
# case ALLOW_TRUST:
|
|
25
|
+
# AllowTrustOp allowTrustOp;
|
|
26
|
+
# case ACCOUNT_MERGE:
|
|
27
|
+
# AccountID destination;
|
|
28
|
+
# case INFLATION:
|
|
29
|
+
# void;
|
|
30
|
+
# }
|
|
31
|
+
#
|
|
32
|
+
# ===========================================================================
|
|
33
|
+
module Stellar
|
|
34
|
+
class Operation
|
|
35
|
+
class Body < XDR::Union
|
|
36
|
+
switch_on OperationType, :type
|
|
37
|
+
|
|
38
|
+
switch :create_account, :create_account_op
|
|
39
|
+
switch :payment, :payment_op
|
|
40
|
+
switch :path_payment, :path_payment_op
|
|
41
|
+
switch :manage_offer, :manage_offer_op
|
|
42
|
+
switch :create_passive_offer, :create_passive_offer_op
|
|
43
|
+
switch :set_options, :set_options_op
|
|
44
|
+
switch :change_trust, :change_trust_op
|
|
45
|
+
switch :allow_trust, :allow_trust_op
|
|
46
|
+
switch :account_merge, :destination
|
|
47
|
+
switch :inflation
|
|
48
|
+
|
|
49
|
+
attribute :create_account_op, CreateAccountOp
|
|
50
|
+
attribute :payment_op, PaymentOp
|
|
51
|
+
attribute :path_payment_op, PathPaymentOp
|
|
52
|
+
attribute :manage_offer_op, ManageOfferOp
|
|
53
|
+
attribute :create_passive_offer_op, CreatePassiveOfferOp
|
|
54
|
+
attribute :set_options_op, SetOptionsOp
|
|
55
|
+
attribute :change_trust_op, ChangeTrustOp
|
|
56
|
+
attribute :allow_trust_op, AllowTrustOp
|
|
57
|
+
attribute :destination, AccountID
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
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 OperationMeta
|
|
9
|
+
# {
|
|
10
|
+
# LedgerEntryChanges changes;
|
|
11
|
+
# };
|
|
12
|
+
#
|
|
13
|
+
# ===========================================================================
|
|
14
|
+
module Stellar
|
|
15
|
+
class OperationMeta < XDR::Struct
|
|
16
|
+
attribute :changes, LedgerEntryChanges
|
|
17
|
+
end
|
|
18
|
+
end
|