stellar-base 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.travis.yml +15 -0
- data/.yardopts +8 -0
- data/Gemfile +15 -0
- data/Guardfile +5 -0
- data/LICENSE.txt +202 -0
- data/README.md +79 -0
- data/Rakefile +6 -0
- data/examples/low_level_transaction_post.rb +53 -0
- data/examples/mid_level_transaction_post.rb +34 -0
- data/examples/non_native_payment.rb +60 -0
- data/generated/stellar/account_entry.rb +37 -0
- data/generated/stellar/account_flags.rb +20 -0
- data/generated/stellar/account_merge_result.rb +25 -0
- data/generated/stellar/account_merge_result_code.rb +30 -0
- data/generated/stellar/allow_trust_op/currency.rb +28 -0
- data/generated/stellar/allow_trust_op.rb +35 -0
- data/generated/stellar/allow_trust_result.rb +25 -0
- data/generated/stellar/allow_trust_result_code.rb +28 -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 +28 -0
- data/generated/stellar/claim_offer_atom.rb +29 -0
- data/generated/stellar/create_offer_effect.rb +24 -0
- data/generated/stellar/create_offer_op.rb +28 -0
- data/generated/stellar/create_offer_result.rb +26 -0
- data/generated/stellar/create_offer_result_code.rb +45 -0
- data/generated/stellar/create_offer_success_result/offer.rb +30 -0
- data/generated/stellar/create_offer_success_result.rb +34 -0
- data/generated/stellar/currency.rb +29 -0
- data/generated/stellar/currency_type.rb +22 -0
- data/generated/stellar/decorated_signature.rb +20 -0
- data/generated/stellar/dont_have.rb +20 -0
- data/generated/stellar/error.rb +20 -0
- data/generated/stellar/hello.rb +24 -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/iso_currency_issuer.rb +20 -0
- data/generated/stellar/ledger_entry.rb +33 -0
- data/generated/stellar/ledger_entry_type.rb +24 -0
- data/generated/stellar/ledger_header.rb +45 -0
- data/generated/stellar/ledger_header_history_entry.rb +20 -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_key.rb +50 -0
- data/generated/stellar/message_type.rb +45 -0
- data/generated/stellar/offer_entry.rb +34 -0
- data/generated/stellar/operation/body.rb +49 -0
- data/generated/stellar/operation.rb +45 -0
- data/generated/stellar/operation_result/tr.rb +49 -0
- data/generated/stellar/operation_result.rb +47 -0
- data/generated/stellar/operation_result_code.rb +25 -0
- data/generated/stellar/operation_type.rb +32 -0
- data/generated/stellar/payment_op.rb +35 -0
- data/generated/stellar/payment_result.rb +29 -0
- data/generated/stellar/payment_result_code.rb +41 -0
- data/generated/stellar/payment_success_multi_result.rb +20 -0
- data/generated/stellar/peer_address.rb +22 -0
- data/generated/stellar/price.rb +20 -0
- data/generated/stellar/scp_ballot.rb +20 -0
- data/generated/stellar/scp_envelope.rb +22 -0
- data/generated/stellar/scp_quorum_set.rb +20 -0
- data/generated/stellar/scp_statement/pledges/prepare.rb +24 -0
- data/generated/stellar/scp_statement/pledges.rb +40 -0
- data/generated/stellar/scp_statement.rb +42 -0
- data/generated/stellar/scp_statement_type.rb +26 -0
- data/generated/stellar/set_options_op.rb +31 -0
- data/generated/stellar/set_options_result.rb +25 -0
- data/generated/stellar/set_options_result_code.rb +28 -0
- data/generated/stellar/signer.rb +20 -0
- data/generated/stellar/simple_payment_result.rb +22 -0
- data/generated/stellar/stellar_ballot.rb +22 -0
- data/generated/stellar/stellar_ballot_value.rb +22 -0
- data/generated/stellar/stellar_message.rb +66 -0
- data/generated/stellar/transaction.rb +37 -0
- data/generated/stellar/transaction_envelope.rb +20 -0
- data/generated/stellar/transaction_history_entry.rb +20 -0
- data/generated/stellar/transaction_history_result_entry.rb +20 -0
- data/generated/stellar/transaction_meta.rb +18 -0
- data/generated/stellar/transaction_result/result.rb +30 -0
- data/generated/stellar/transaction_result.rb +33 -0
- data/generated/stellar/transaction_result_code.rb +46 -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 +28 -0
- data/generated/stellar-base-generated.rb +160 -0
- data/lib/stellar/base/version.rb +5 -0
- data/lib/stellar/base.rb +1 -0
- data/lib/stellar/change_trust_op.rb +10 -0
- data/lib/stellar/currency.rb +28 -0
- data/lib/stellar/key_pair.rb +94 -0
- data/lib/stellar/payment_op.rb +38 -0
- data/lib/stellar/transaction.rb +72 -0
- data/lib/stellar/transaction_envelope.rb +32 -0
- data/lib/stellar/util/base58.rb +127 -0
- data/lib/stellar-base.rb +23 -0
- data/ruby-stellar-base.gemspec +34 -0
- data/spec/lib/stellar/key_pair_spec.rb +199 -0
- data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
- data/spec/lib/stellar/transaction_spec.rb +43 -0
- data/spec/lib/stellar/util/base58_spec.rb +74 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/matchers/be_base58_check.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 +9 -0
- data/tasks/xdr.rake +48 -0
- data/xdr/SCPXDR.x +61 -0
- data/xdr/Stellar-ledger-entries.x +105 -0
- data/xdr/Stellar-ledger.x +117 -0
- data/xdr/Stellar-overlay.x +100 -0
- data/xdr/Stellar-transaction.x +497 -0
- data/xdr/Stellar-types.x +53 -0
- data/xdr/StellarXDR.x +11 -0
- metadata +342 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct AllowTrustOp
|
9
|
+
# {
|
10
|
+
# AccountID trustor;
|
11
|
+
# union switch (CurrencyType type)
|
12
|
+
# {
|
13
|
+
# // NATIVE is not allowed
|
14
|
+
# case ISO4217:
|
15
|
+
# opaque currencyCode[4];
|
16
|
+
#
|
17
|
+
# // add other currency types here in the future
|
18
|
+
# }
|
19
|
+
# currency;
|
20
|
+
#
|
21
|
+
# bool authorize;
|
22
|
+
# };
|
23
|
+
#
|
24
|
+
# ===========================================================================
|
25
|
+
module Stellar
|
26
|
+
class AllowTrustOp < XDR::Struct
|
27
|
+
include XDR::Namespace
|
28
|
+
|
29
|
+
autoload :Currency
|
30
|
+
|
31
|
+
attribute :trustor, AccountID
|
32
|
+
attribute :currency, Currency
|
33
|
+
attribute :authorize, XDR::Bool
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union AllowTrustResult switch (AllowTrustResultCode code)
|
9
|
+
# {
|
10
|
+
# case ALLOW_TRUST_SUCCESS:
|
11
|
+
# void;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class AllowTrustResult < XDR::Union
|
19
|
+
switch_on AllowTrustResultCode, :code
|
20
|
+
|
21
|
+
switch :allow_trust_success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum AllowTrustResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# ALLOW_TRUST_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# ALLOW_TRUST_MALFORMED = 1, // currency is not ISO4217
|
14
|
+
# ALLOW_TRUST_NO_TRUST_LINE = 2, // trustor does not have a trustline
|
15
|
+
# ALLOW_TRUST_TRUST_NOT_REQUIRED = 3 // source account does not require trust
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class AllowTrustResultCode < XDR::Enum
|
21
|
+
member :allow_trust_success, 0
|
22
|
+
member :allow_trust_malformed, 1
|
23
|
+
member :allow_trust_no_trust_line, 2
|
24
|
+
member :allow_trust_trust_not_required, 3
|
25
|
+
|
26
|
+
seal
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union BucketEntry switch (BucketEntryType type)
|
9
|
+
# {
|
10
|
+
# case LIVEENTRY:
|
11
|
+
# LedgerEntry liveEntry;
|
12
|
+
#
|
13
|
+
# case DEADENTRY:
|
14
|
+
# LedgerKey deadEntry;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class BucketEntry < XDR::Union
|
20
|
+
switch_on BucketEntryType, :type
|
21
|
+
|
22
|
+
switch :liveentry, :live_entry
|
23
|
+
switch :deadentry, :dead_entry
|
24
|
+
|
25
|
+
attribute :live_entry, LedgerEntry
|
26
|
+
attribute :dead_entry, LedgerKey
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum BucketEntryType
|
9
|
+
# {
|
10
|
+
# LIVEENTRY = 0,
|
11
|
+
# DEADENTRY = 1
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class BucketEntryType < XDR::Enum
|
17
|
+
member :liveentry, 0
|
18
|
+
member :deadentry, 1
|
19
|
+
|
20
|
+
seal
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct ChangeTrustOp
|
9
|
+
# {
|
10
|
+
# Currency line;
|
11
|
+
#
|
12
|
+
# // if limit is set to 0, deletes the trust line
|
13
|
+
# int64 limit;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ChangeTrustOp < XDR::Struct
|
19
|
+
attribute :line, Currency
|
20
|
+
attribute :limit, Int64
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union ChangeTrustResult switch (ChangeTrustResultCode code)
|
9
|
+
# {
|
10
|
+
# case CHANGE_TRUST_SUCCESS:
|
11
|
+
# void;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ChangeTrustResult < XDR::Union
|
19
|
+
switch_on ChangeTrustResultCode, :code
|
20
|
+
|
21
|
+
switch :change_trust_success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum ChangeTrustResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# CHANGE_TRUST_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# CHANGE_TRUST_NO_ISSUER = 1, // could not find issuer
|
14
|
+
# CHANGE_TRUST_INVALID_LIMIT = 2, // cannot drop limit below balance
|
15
|
+
# CHANGE_TRUST_LOW_RESERVE = 3 // not enough funds to create a new trust line
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class ChangeTrustResultCode < XDR::Enum
|
21
|
+
member :change_trust_success, 0
|
22
|
+
member :change_trust_no_issuer, 1
|
23
|
+
member :change_trust_invalid_limit, 2
|
24
|
+
member :change_trust_low_reserve, 3
|
25
|
+
|
26
|
+
seal
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct ClaimOfferAtom
|
9
|
+
# {
|
10
|
+
# // emited to identify the offer
|
11
|
+
# AccountID offerOwner; // Account that owns the offer
|
12
|
+
# uint64 offerID;
|
13
|
+
#
|
14
|
+
# // amount and currency taken from the owner
|
15
|
+
# Currency currencyClaimed;
|
16
|
+
# int64 amountClaimed;
|
17
|
+
#
|
18
|
+
# // should we also include the amount that the owner gets in return?
|
19
|
+
# };
|
20
|
+
#
|
21
|
+
# ===========================================================================
|
22
|
+
module Stellar
|
23
|
+
class ClaimOfferAtom < XDR::Struct
|
24
|
+
attribute :offer_owner, AccountID
|
25
|
+
attribute :offer_id, Uint64
|
26
|
+
attribute :currency_claimed, Currency
|
27
|
+
attribute :amount_claimed, Int64
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum CreateOfferEffect
|
9
|
+
# {
|
10
|
+
# CREATE_OFFER_CREATED = 0,
|
11
|
+
# CREATE_OFFER_UPDATED = 1,
|
12
|
+
# CREATE_OFFER_DELETED = 2
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class CreateOfferEffect < XDR::Enum
|
18
|
+
member :create_offer_created, 0
|
19
|
+
member :create_offer_updated, 1
|
20
|
+
member :create_offer_deleted, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct CreateOfferOp
|
9
|
+
# {
|
10
|
+
# Currency takerGets;
|
11
|
+
# Currency takerPays;
|
12
|
+
# int64 amount; // amount taker gets. if set to 0, delete the offer
|
13
|
+
# Price price; // =takerPaysAmount/takerGetsAmount
|
14
|
+
#
|
15
|
+
# // 0=create a new offer, otherwise edit an existing offer
|
16
|
+
# uint64 offerID;
|
17
|
+
# };
|
18
|
+
#
|
19
|
+
# ===========================================================================
|
20
|
+
module Stellar
|
21
|
+
class CreateOfferOp < XDR::Struct
|
22
|
+
attribute :taker_gets, Currency
|
23
|
+
attribute :taker_pays, Currency
|
24
|
+
attribute :amount, Int64
|
25
|
+
attribute :price, Price
|
26
|
+
attribute :offer_id, Uint64
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union CreateOfferResult switch (CreateOfferResultCode code)
|
9
|
+
# {
|
10
|
+
# case CREATE_OFFER_SUCCESS:
|
11
|
+
# CreateOfferSuccessResult success;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class CreateOfferResult < XDR::Union
|
19
|
+
switch_on CreateOfferResultCode, :code
|
20
|
+
|
21
|
+
switch :create_offer_success, :success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
attribute :success, CreateOfferSuccessResult
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum CreateOfferResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# CREATE_OFFER_SUCCESS = 0,
|
12
|
+
#
|
13
|
+
# // codes considered as "failure" for the operation
|
14
|
+
# CREATE_OFFER_NO_TRUST = 1, // can't hold what it's buying
|
15
|
+
# CREATE_OFFER_NOT_AUTHORIZED = 2, // not authorized to hold what it's buying
|
16
|
+
# CREATE_OFFER_LINE_FULL = 3, // can't receive more of what it's buying
|
17
|
+
# CREATE_OFFER_MALFORMED = 4, // generated offer would be invalid
|
18
|
+
# CREATE_OFFER_UNDERFUNDED = 5, // doesn't hold what it's trying to sell
|
19
|
+
# CREATE_OFFER_CROSS_SELF = 6, // would cross an offer from the same user
|
20
|
+
#
|
21
|
+
# // update errors
|
22
|
+
# CREATE_OFFER_NOT_FOUND = 7, // offerID does not match an existing offer
|
23
|
+
# CREATE_OFFER_MISMATCH = 8, // currencies don't match offer
|
24
|
+
#
|
25
|
+
# CREATE_OFFER_LOW_RESERVE = 9 // not enough funds to create a new Offer
|
26
|
+
#
|
27
|
+
# };
|
28
|
+
#
|
29
|
+
# ===========================================================================
|
30
|
+
module Stellar
|
31
|
+
class CreateOfferResultCode < XDR::Enum
|
32
|
+
member :create_offer_success, 0
|
33
|
+
member :create_offer_no_trust, 1
|
34
|
+
member :create_offer_not_authorized, 2
|
35
|
+
member :create_offer_line_full, 3
|
36
|
+
member :create_offer_malformed, 4
|
37
|
+
member :create_offer_underfunded, 5
|
38
|
+
member :create_offer_cross_self, 6
|
39
|
+
member :create_offer_not_found, 7
|
40
|
+
member :create_offer_mismatch, 8
|
41
|
+
member :create_offer_low_reserve, 9
|
42
|
+
|
43
|
+
seal
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union switch (CreateOfferEffect effect)
|
9
|
+
# {
|
10
|
+
# case CREATE_OFFER_CREATED:
|
11
|
+
# case CREATE_OFFER_UPDATED:
|
12
|
+
# OfferEntry offer;
|
13
|
+
# default:
|
14
|
+
# void;
|
15
|
+
# }
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class CreateOfferSuccessResult
|
20
|
+
class Offer < XDR::Union
|
21
|
+
switch_on CreateOfferEffect, :effect
|
22
|
+
|
23
|
+
switch :create_offer_created, :offer
|
24
|
+
switch :create_offer_updated, :offer
|
25
|
+
switch :default
|
26
|
+
|
27
|
+
attribute :offer, OfferEntry
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct CreateOfferSuccessResult
|
9
|
+
# {
|
10
|
+
# // offers that got claimed while creating this offer
|
11
|
+
# ClaimOfferAtom offersClaimed<>;
|
12
|
+
#
|
13
|
+
# union switch (CreateOfferEffect effect)
|
14
|
+
# {
|
15
|
+
# case CREATE_OFFER_CREATED:
|
16
|
+
# case CREATE_OFFER_UPDATED:
|
17
|
+
# OfferEntry offer;
|
18
|
+
# default:
|
19
|
+
# void;
|
20
|
+
# }
|
21
|
+
# offer;
|
22
|
+
# };
|
23
|
+
#
|
24
|
+
# ===========================================================================
|
25
|
+
module Stellar
|
26
|
+
class CreateOfferSuccessResult < 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,29 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union Currency switch (CurrencyType type)
|
9
|
+
# {
|
10
|
+
# case NATIVE:
|
11
|
+
# void;
|
12
|
+
#
|
13
|
+
# case ISO4217:
|
14
|
+
# ISOCurrencyIssuer isoCI;
|
15
|
+
#
|
16
|
+
# // add other currency types here in the future
|
17
|
+
# };
|
18
|
+
#
|
19
|
+
# ===========================================================================
|
20
|
+
module Stellar
|
21
|
+
class Currency < XDR::Union
|
22
|
+
switch_on CurrencyType, :type
|
23
|
+
|
24
|
+
switch :native
|
25
|
+
switch :iso4217, :iso_ci
|
26
|
+
|
27
|
+
attribute :iso_ci, ISOCurrencyIssuer
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum CurrencyType
|
9
|
+
# {
|
10
|
+
# NATIVE = 0,
|
11
|
+
# ISO4217 = 1
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class CurrencyType < XDR::Enum
|
17
|
+
member :native, 0
|
18
|
+
member :iso4217, 1
|
19
|
+
|
20
|
+
seal
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct DecoratedSignature
|
9
|
+
# {
|
10
|
+
# opaque hint[4]; // first 4 bytes of the public key, used as a hint
|
11
|
+
# uint512 signature; // actual signature
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class DecoratedSignature < XDR::Struct
|
17
|
+
attribute :hint, XDR::Opaque[4]
|
18
|
+
attribute :signature, Uint512
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct 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,20 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct 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,24 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct Hello
|
9
|
+
# {
|
10
|
+
# int protocolVersion;
|
11
|
+
# string versionStr<100>;
|
12
|
+
# int listeningPort;
|
13
|
+
# opaque peerID[32];
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class Hello < XDR::Struct
|
19
|
+
attribute :protocol_version, XDR::Int
|
20
|
+
attribute :version_str, XDR::String[100]
|
21
|
+
attribute :listening_port, XDR::Int
|
22
|
+
attribute :peer_id, XDR::Opaque[32]
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct 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
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union 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
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum 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,20 @@
|
|
1
|
+
# Automatically generated on 2015-04-07T10:52:07-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct ISOCurrencyIssuer
|
9
|
+
# {
|
10
|
+
# opaque currencyCode[4];
|
11
|
+
# AccountID issuer;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class ISOCurrencyIssuer < XDR::Struct
|
17
|
+
attribute :currency_code, XDR::Opaque[4]
|
18
|
+
attribute :issuer, AccountID
|
19
|
+
end
|
20
|
+
end
|