auction-ruby-base 0.1.1
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/CHANGELOG.md +58 -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/auction-ruby-base.gemspec +35 -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 +174 -0
- data/generated/stellar/account_entry.rb +55 -0
- data/generated/stellar/account_entry/ext.rb +24 -0
- data/generated/stellar/account_flags.rb +31 -0
- data/generated/stellar/account_merge_result.rb +26 -0
- data/generated/stellar/account_merge_result_code.rb +30 -0
- data/generated/stellar/affirm_fail_op.rb +22 -0
- data/generated/stellar/affirm_fail_result.rb +25 -0
- data/generated/stellar/affirm_fail_result_code.rb +22 -0
- data/generated/stellar/affirm_pass_op.rb +24 -0
- data/generated/stellar/affirm_pass_result.rb +25 -0
- data/generated/stellar/affirm_pass_result_code.rb +22 -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/auth.rb +20 -0
- data/generated/stellar/auth_cert.rb +22 -0
- data/generated/stellar/authenticated_message.rb +32 -0
- data/generated/stellar/authenticated_message/v0.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 +31 -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_bid_op.rb +20 -0
- data/generated/stellar/create_bid_result.rb +25 -0
- data/generated/stellar/create_bid_result_code.rb +22 -0
- data/generated/stellar/create_lot_op.rb +46 -0
- data/generated/stellar/create_lot_result.rb +25 -0
- data/generated/stellar/create_lot_result_code.rb +22 -0
- data/generated/stellar/create_passive_offer_op.rb +24 -0
- data/generated/stellar/crypto_key_type.rb +20 -0
- data/generated/stellar/curve25519_public.rb +18 -0
- data/generated/stellar/curve25519_secret.rb +18 -0
- data/generated/stellar/decorated_signature.rb +20 -0
- data/generated/stellar/dont_have.rb +20 -0
- data/generated/stellar/envelope_type.rb +24 -0
- data/generated/stellar/error.rb +20 -0
- data/generated/stellar/error_code.rb +28 -0
- data/generated/stellar/hello.rb +34 -0
- data/generated/stellar/hmac_sha256_key.rb +18 -0
- data/generated/stellar/hmac_sha256_mac.rb +18 -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/ip_addr_type.rb +22 -0
- data/generated/stellar/ledger_entry.rb +52 -0
- data/generated/stellar/ledger_entry/data.rb +49 -0
- data/generated/stellar/ledger_entry/ext.rb +24 -0
- data/generated/stellar/ledger_entry_change.rb +35 -0
- data/generated/stellar/ledger_entry_change_type.rb +26 -0
- data/generated/stellar/ledger_entry_type.rb +32 -0
- data/generated/stellar/ledger_header.rb +69 -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 +87 -0
- data/generated/stellar/ledger_key/account.rb +20 -0
- data/generated/stellar/ledger_key/lot.rb +22 -0
- data/generated/stellar/ledger_key/message.rb +22 -0
- data/generated/stellar/ledger_key/offer.rb +22 -0
- data/generated/stellar/ledger_key/participant.rb +22 -0
- data/generated/stellar/ledger_key/proof.rb +22 -0
- data/generated/stellar/ledger_key/trust_line.rb +22 -0
- data/generated/stellar/ledger_scp_messages.rb +20 -0
- data/generated/stellar/ledger_upgrade.rb +31 -0
- data/generated/stellar/ledger_upgrade_type.rb +24 -0
- data/generated/stellar/lot_branch.rb +21 -0
- data/generated/stellar/lot_entry.rb +64 -0
- data/generated/stellar/lot_entry/ext.rb +24 -0
- data/generated/stellar/lot_type.rb +21 -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 +50 -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_entry.rb +38 -0
- data/generated/stellar/message_entry/ext.rb +24 -0
- data/generated/stellar/message_type.rb +51 -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 +65 -0
- data/generated/stellar/operation/body.rb +88 -0
- data/generated/stellar/operation_meta.rb +18 -0
- data/generated/stellar/operation_result.rb +67 -0
- data/generated/stellar/operation_result/tr.rb +89 -0
- data/generated/stellar/operation_result_code.rb +25 -0
- data/generated/stellar/operation_type.rb +52 -0
- data/generated/stellar/participant_entry.rb +39 -0
- data/generated/stellar/participant_entry/ext.rb +24 -0
- data/generated/stellar/participant_state.rb +25 -0
- data/generated/stellar/path_payment_op.rb +32 -0
- data/generated/stellar/path_payment_result.rb +38 -0
- data/generated/stellar/path_payment_result/success.rb +22 -0
- data/generated/stellar/path_payment_result_code.rb +47 -0
- data/generated/stellar/payment_op.rb +22 -0
- data/generated/stellar/payment_result.rb +25 -0
- data/generated/stellar/payment_result_code.rb +41 -0
- data/generated/stellar/peer_address.rb +33 -0
- data/generated/stellar/peer_address/ip.rb +29 -0
- data/generated/stellar/price.rb +20 -0
- data/generated/stellar/proof_entry.rb +42 -0
- data/generated/stellar/proof_entry/ext.rb +24 -0
- data/generated/stellar/provide_proof_op.rb +24 -0
- data/generated/stellar/provide_proof_result.rb +25 -0
- data/generated/stellar/provide_proof_result_code.rb +22 -0
- data/generated/stellar/public_key.rb +23 -0
- data/generated/stellar/register_participant_op.rb +22 -0
- data/generated/stellar/register_participant_result.rb +25 -0
- data/generated/stellar/register_participant_result_code.rb +22 -0
- data/generated/stellar/scp_ballot.rb +20 -0
- data/generated/stellar/scp_envelope.rb +20 -0
- data/generated/stellar/scp_history_entry.rb +23 -0
- data/generated/stellar/scp_history_entry_v0.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 +58 -0
- data/generated/stellar/scp_statement/pledges.rb +63 -0
- data/generated/stellar/scp_statement/pledges/confirm.rb +30 -0
- data/generated/stellar/scp_statement/pledges/externalize.rb +26 -0
- data/generated/stellar/scp_statement/pledges/prepare.rb +32 -0
- data/generated/stellar/scp_statement_type.rb +26 -0
- data/generated/stellar/send_message_op.rb +22 -0
- data/generated/stellar/send_message_result.rb +25 -0
- data/generated/stellar/send_message_result_code.rb +22 -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 +40 -0
- data/generated/stellar/signer.rb +20 -0
- data/generated/stellar/simple_payment_result.rb +22 -0
- data/generated/stellar/stellar_message.rb +74 -0
- data/generated/stellar/stellar_value.rb +41 -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 +23 -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 +33 -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 +384 -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 +205 -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/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/operation_spec.rb +13 -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 +83 -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 +86 -0
- data/xdr/Stellar-ledger-entries.x +351 -0
- data/xdr/Stellar-ledger.x +288 -0
- data/xdr/Stellar-overlay.x +146 -0
- data/xdr/Stellar-transaction.x +936 -0
- data/xdr/Stellar-types.x +55 -0
- metadata +495 -0
@@ -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 LotEntry
|
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 LotType {
|
9
|
+
# TERRITORY = 1,
|
10
|
+
# FACILITY = 2
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class LotType < XDR::Enum
|
16
|
+
member :territory, 1
|
17
|
+
member :facility, 2
|
18
|
+
|
19
|
+
seal
|
20
|
+
end
|
21
|
+
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 ManageOfferEffect
|
9
|
+
# {
|
10
|
+
# MANAGE_OFFER_CREATED = 0,
|
11
|
+
# MANAGE_OFFER_UPDATED = 1,
|
12
|
+
# MANAGE_OFFER_DELETED = 2
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class ManageOfferEffect < XDR::Enum
|
18
|
+
member :manage_offer_created, 0
|
19
|
+
member :manage_offer_updated, 1
|
20
|
+
member :manage_offer_deleted, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
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
|
+
# struct ManageOfferOp
|
9
|
+
# {
|
10
|
+
# Asset selling;
|
11
|
+
# Asset buying;
|
12
|
+
# int64 amount; // amount being sold. if set to 0, delete the offer
|
13
|
+
# Price price; // price of thing being sold in terms of what you are buying
|
14
|
+
#
|
15
|
+
# // 0=create a new offer, otherwise edit an existing offer
|
16
|
+
# uint64 offerID;
|
17
|
+
# };
|
18
|
+
#
|
19
|
+
# ===========================================================================
|
20
|
+
module Stellar
|
21
|
+
class ManageOfferOp < XDR::Struct
|
22
|
+
attribute :selling, Asset
|
23
|
+
attribute :buying, Asset
|
24
|
+
attribute :amount, Int64
|
25
|
+
attribute :price, Price
|
26
|
+
attribute :offer_id, Uint64
|
27
|
+
end
|
28
|
+
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 ManageOfferResult switch (ManageOfferResultCode code)
|
9
|
+
# {
|
10
|
+
# case MANAGE_OFFER_SUCCESS:
|
11
|
+
# ManageOfferSuccessResult success;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ManageOfferResult < XDR::Union
|
19
|
+
switch_on ManageOfferResultCode, :code
|
20
|
+
|
21
|
+
switch :manage_offer_success, :success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
attribute :success, ManageOfferSuccessResult
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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
|
+
# MANAGE_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
|
23
|
+
# MANAGE_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying
|
24
|
+
#
|
25
|
+
# // update errors
|
26
|
+
# MANAGE_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer
|
27
|
+
#
|
28
|
+
# MANAGE_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
|
29
|
+
# };
|
30
|
+
#
|
31
|
+
# ===========================================================================
|
32
|
+
module Stellar
|
33
|
+
class ManageOfferResultCode < XDR::Enum
|
34
|
+
member :manage_offer_success, 0
|
35
|
+
member :manage_offer_malformed, -1
|
36
|
+
member :manage_offer_sell_no_trust, -2
|
37
|
+
member :manage_offer_buy_no_trust, -3
|
38
|
+
member :manage_offer_sell_not_authorized, -4
|
39
|
+
member :manage_offer_buy_not_authorized, -5
|
40
|
+
member :manage_offer_line_full, -6
|
41
|
+
member :manage_offer_underfunded, -7
|
42
|
+
member :manage_offer_cross_self, -8
|
43
|
+
member :manage_offer_sell_no_issuer, -9
|
44
|
+
member :manage_offer_buy_no_issuer, -10
|
45
|
+
member :manage_offer_not_found, -11
|
46
|
+
member :manage_offer_low_reserve, -12
|
47
|
+
|
48
|
+
seal
|
49
|
+
end
|
50
|
+
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,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
|
+
# struct MessageEntry
|
9
|
+
# {
|
10
|
+
# uint64 messageID;
|
11
|
+
# AccountID accountID;
|
12
|
+
# string text<1000>;
|
13
|
+
# uint64 lotID;
|
14
|
+
# uint64 refMessageID;
|
15
|
+
# // reserved for future use
|
16
|
+
# union switch (int v)
|
17
|
+
# {
|
18
|
+
# case 0:
|
19
|
+
# void;
|
20
|
+
# }
|
21
|
+
# ext;
|
22
|
+
# };
|
23
|
+
#
|
24
|
+
# ===========================================================================
|
25
|
+
module Stellar
|
26
|
+
class MessageEntry < XDR::Struct
|
27
|
+
include XDR::Namespace
|
28
|
+
|
29
|
+
autoload :Ext
|
30
|
+
|
31
|
+
attribute :message_id, Uint64
|
32
|
+
attribute :account_id, AccountID
|
33
|
+
attribute :text, XDR::String[1000]
|
34
|
+
attribute :lot_id, Uint64
|
35
|
+
attribute :ref_message_id, Uint64
|
36
|
+
attribute :ext, Ext
|
37
|
+
end
|
38
|
+
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 MessageEntry
|
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,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
|
+
# enum MessageType
|
9
|
+
# {
|
10
|
+
# ERROR_MSG = 0,
|
11
|
+
# AUTH = 2,
|
12
|
+
# DONT_HAVE = 3,
|
13
|
+
#
|
14
|
+
# GET_PEERS = 4, // gets a list of peers this guy knows about
|
15
|
+
# PEERS = 5,
|
16
|
+
#
|
17
|
+
# GET_TX_SET = 6, // gets a particular txset by hash
|
18
|
+
# TX_SET = 7,
|
19
|
+
#
|
20
|
+
# TRANSACTION = 8, // pass on a tx you have heard about
|
21
|
+
#
|
22
|
+
# // SCP
|
23
|
+
# GET_SCP_QUORUMSET = 9,
|
24
|
+
# SCP_QUORUMSET = 10,
|
25
|
+
# SCP_MESSAGE = 11,
|
26
|
+
# GET_SCP_STATE = 12,
|
27
|
+
#
|
28
|
+
# // new messages
|
29
|
+
# HELLO = 13
|
30
|
+
# };
|
31
|
+
#
|
32
|
+
# ===========================================================================
|
33
|
+
module Stellar
|
34
|
+
class MessageType < XDR::Enum
|
35
|
+
member :error_msg, 0
|
36
|
+
member :auth, 2
|
37
|
+
member :dont_have, 3
|
38
|
+
member :get_peers, 4
|
39
|
+
member :peers, 5
|
40
|
+
member :get_tx_set, 6
|
41
|
+
member :tx_set, 7
|
42
|
+
member :transaction, 8
|
43
|
+
member :get_scp_quorumset, 9
|
44
|
+
member :scp_quorumset, 10
|
45
|
+
member :scp_message, 11
|
46
|
+
member :get_scp_state, 12
|
47
|
+
member :hello, 13
|
48
|
+
|
49
|
+
seal
|
50
|
+
end
|
51
|
+
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
|