stellar-base 0.0.1
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 +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,33 @@
|
|
|
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 LedgerEntry switch (LedgerEntryType type)
|
|
9
|
+
# {
|
|
10
|
+
# case ACCOUNT:
|
|
11
|
+
# AccountEntry account;
|
|
12
|
+
#
|
|
13
|
+
# case TRUSTLINE:
|
|
14
|
+
# TrustLineEntry trustLine;
|
|
15
|
+
#
|
|
16
|
+
# case OFFER:
|
|
17
|
+
# OfferEntry offer;
|
|
18
|
+
# };
|
|
19
|
+
#
|
|
20
|
+
# ===========================================================================
|
|
21
|
+
module Stellar
|
|
22
|
+
class LedgerEntry < XDR::Union
|
|
23
|
+
switch_on LedgerEntryType, :type
|
|
24
|
+
|
|
25
|
+
switch :account, :account
|
|
26
|
+
switch :trustline, :trust_line
|
|
27
|
+
switch :offer, :offer
|
|
28
|
+
|
|
29
|
+
attribute :account, AccountEntry
|
|
30
|
+
attribute :trust_line, TrustLineEntry
|
|
31
|
+
attribute :offer, OfferEntry
|
|
32
|
+
end
|
|
33
|
+
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 LedgerEntryType
|
|
9
|
+
# {
|
|
10
|
+
# ACCOUNT = 0,
|
|
11
|
+
# TRUSTLINE = 1,
|
|
12
|
+
# OFFER = 2
|
|
13
|
+
# };
|
|
14
|
+
#
|
|
15
|
+
# ===========================================================================
|
|
16
|
+
module Stellar
|
|
17
|
+
class LedgerEntryType < XDR::Enum
|
|
18
|
+
member :account, 0
|
|
19
|
+
member :trustline, 1
|
|
20
|
+
member :offer, 2
|
|
21
|
+
|
|
22
|
+
seal
|
|
23
|
+
end
|
|
24
|
+
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
|
+
# struct LedgerHeader
|
|
9
|
+
# {
|
|
10
|
+
# Hash previousLedgerHash; // hash of the previous ledger header
|
|
11
|
+
# Hash txSetHash; // the tx set that was SCP confirmed
|
|
12
|
+
# Hash txSetResultHash; // the TransactionResultSet that led to this ledger
|
|
13
|
+
# Hash bucketListHash; // hash of the ledger state
|
|
14
|
+
#
|
|
15
|
+
# uint32 ledgerSeq; // sequence number of this ledger
|
|
16
|
+
# uint64 closeTime; // network close time
|
|
17
|
+
#
|
|
18
|
+
# int64 totalCoins; // total number of stroops in existence
|
|
19
|
+
#
|
|
20
|
+
# int64 feePool; // fees burned since last inflation run
|
|
21
|
+
# uint32 inflationSeq; // inflation sequence number
|
|
22
|
+
#
|
|
23
|
+
# uint64 idPool; // last used global ID, used for generating objects
|
|
24
|
+
#
|
|
25
|
+
# int32 baseFee; // base fee per operation in stroops
|
|
26
|
+
# int32 baseReserve; // account base reserve in stroops
|
|
27
|
+
# };
|
|
28
|
+
#
|
|
29
|
+
# ===========================================================================
|
|
30
|
+
module Stellar
|
|
31
|
+
class LedgerHeader < XDR::Struct
|
|
32
|
+
attribute :previous_ledger_hash, Hash
|
|
33
|
+
attribute :tx_set_hash, Hash
|
|
34
|
+
attribute :tx_set_result_hash, Hash
|
|
35
|
+
attribute :bucket_list_hash, Hash
|
|
36
|
+
attribute :ledger_seq, Uint32
|
|
37
|
+
attribute :close_time, Uint64
|
|
38
|
+
attribute :total_coins, Int64
|
|
39
|
+
attribute :fee_pool, Int64
|
|
40
|
+
attribute :inflation_seq, Uint32
|
|
41
|
+
attribute :id_pool, Uint64
|
|
42
|
+
attribute :base_fee, Int32
|
|
43
|
+
attribute :base_reserve, Int32
|
|
44
|
+
end
|
|
45
|
+
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 LedgerHeaderHistoryEntry
|
|
9
|
+
# {
|
|
10
|
+
# Hash hash;
|
|
11
|
+
# LedgerHeader header;
|
|
12
|
+
# };
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class LedgerHeaderHistoryEntry < XDR::Struct
|
|
17
|
+
attribute :hash, Hash
|
|
18
|
+
attribute :header, LedgerHeader
|
|
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
|
|
9
|
+
# {
|
|
10
|
+
# AccountID accountID;
|
|
11
|
+
# }
|
|
12
|
+
#
|
|
13
|
+
# ===========================================================================
|
|
14
|
+
module Stellar
|
|
15
|
+
class LedgerKey
|
|
16
|
+
class Account < XDR::Struct
|
|
17
|
+
attribute :account_id, AccountID
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
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
|
|
9
|
+
# {
|
|
10
|
+
# AccountID accountID;
|
|
11
|
+
# uint64 offerID;
|
|
12
|
+
# }
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class LedgerKey
|
|
17
|
+
class Offer < XDR::Struct
|
|
18
|
+
attribute :account_id, AccountID
|
|
19
|
+
attribute :offer_id, Uint64
|
|
20
|
+
end
|
|
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
|
|
9
|
+
# {
|
|
10
|
+
# AccountID accountID;
|
|
11
|
+
# Currency currency;
|
|
12
|
+
# }
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class LedgerKey
|
|
17
|
+
class TrustLine < XDR::Struct
|
|
18
|
+
attribute :account_id, AccountID
|
|
19
|
+
attribute :currency, Currency
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
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 LedgerKey switch (LedgerEntryType type)
|
|
9
|
+
# {
|
|
10
|
+
# case ACCOUNT:
|
|
11
|
+
# struct
|
|
12
|
+
# {
|
|
13
|
+
# AccountID accountID;
|
|
14
|
+
# } account;
|
|
15
|
+
#
|
|
16
|
+
# case TRUSTLINE:
|
|
17
|
+
# struct
|
|
18
|
+
# {
|
|
19
|
+
# AccountID accountID;
|
|
20
|
+
# Currency currency;
|
|
21
|
+
# } trustLine;
|
|
22
|
+
#
|
|
23
|
+
# case OFFER:
|
|
24
|
+
# struct
|
|
25
|
+
# {
|
|
26
|
+
# AccountID accountID;
|
|
27
|
+
# uint64 offerID;
|
|
28
|
+
# } offer;
|
|
29
|
+
# };
|
|
30
|
+
#
|
|
31
|
+
# ===========================================================================
|
|
32
|
+
module Stellar
|
|
33
|
+
class LedgerKey < XDR::Union
|
|
34
|
+
include XDR::Namespace
|
|
35
|
+
|
|
36
|
+
autoload :Account
|
|
37
|
+
autoload :TrustLine
|
|
38
|
+
autoload :Offer
|
|
39
|
+
|
|
40
|
+
switch_on LedgerEntryType, :type
|
|
41
|
+
|
|
42
|
+
switch :account, :account
|
|
43
|
+
switch :trustline, :trust_line
|
|
44
|
+
switch :offer, :offer
|
|
45
|
+
|
|
46
|
+
attribute :account, Account
|
|
47
|
+
attribute :trust_line, TrustLine
|
|
48
|
+
attribute :offer, Offer
|
|
49
|
+
end
|
|
50
|
+
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 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,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 OfferEntry
|
|
9
|
+
# {
|
|
10
|
+
# AccountID accountID;
|
|
11
|
+
# uint64 offerID;
|
|
12
|
+
# Currency takerGets; // A
|
|
13
|
+
# Currency takerPays; // 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
|
+
# };
|
|
23
|
+
#
|
|
24
|
+
# ===========================================================================
|
|
25
|
+
module Stellar
|
|
26
|
+
class OfferEntry < XDR::Struct
|
|
27
|
+
attribute :account_id, AccountID
|
|
28
|
+
attribute :offer_id, Uint64
|
|
29
|
+
attribute :taker_gets, Currency
|
|
30
|
+
attribute :taker_pays, Currency
|
|
31
|
+
attribute :amount, Int64
|
|
32
|
+
attribute :price, Price
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
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 (OperationType type)
|
|
9
|
+
# {
|
|
10
|
+
# case PAYMENT:
|
|
11
|
+
# PaymentOp paymentOp;
|
|
12
|
+
# case CREATE_OFFER:
|
|
13
|
+
# CreateOfferOp createOfferOp;
|
|
14
|
+
# case SET_OPTIONS:
|
|
15
|
+
# SetOptionsOp setOptionsOp;
|
|
16
|
+
# case CHANGE_TRUST:
|
|
17
|
+
# ChangeTrustOp changeTrustOp;
|
|
18
|
+
# case ALLOW_TRUST:
|
|
19
|
+
# AllowTrustOp allowTrustOp;
|
|
20
|
+
# case ACCOUNT_MERGE:
|
|
21
|
+
# uint256 destination;
|
|
22
|
+
# case INFLATION:
|
|
23
|
+
# uint32 inflationSeq;
|
|
24
|
+
# }
|
|
25
|
+
#
|
|
26
|
+
# ===========================================================================
|
|
27
|
+
module Stellar
|
|
28
|
+
class Operation
|
|
29
|
+
class Body < XDR::Union
|
|
30
|
+
switch_on OperationType, :type
|
|
31
|
+
|
|
32
|
+
switch :payment, :payment_op
|
|
33
|
+
switch :create_offer, :create_offer_op
|
|
34
|
+
switch :set_options, :set_options_op
|
|
35
|
+
switch :change_trust, :change_trust_op
|
|
36
|
+
switch :allow_trust, :allow_trust_op
|
|
37
|
+
switch :account_merge, :destination
|
|
38
|
+
switch :inflation, :inflation_seq
|
|
39
|
+
|
|
40
|
+
attribute :payment_op, PaymentOp
|
|
41
|
+
attribute :create_offer_op, CreateOfferOp
|
|
42
|
+
attribute :set_options_op, SetOptionsOp
|
|
43
|
+
attribute :change_trust_op, ChangeTrustOp
|
|
44
|
+
attribute :allow_trust_op, AllowTrustOp
|
|
45
|
+
attribute :destination, Uint256
|
|
46
|
+
attribute :inflation_seq, Uint32
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
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
|
+
# struct Operation
|
|
9
|
+
# {
|
|
10
|
+
# // sourceAccount is the account used to run the operation
|
|
11
|
+
# // if not set, the runtime defaults to "account" specified at
|
|
12
|
+
# // the transaction level
|
|
13
|
+
# AccountID* sourceAccount;
|
|
14
|
+
#
|
|
15
|
+
# union switch (OperationType type)
|
|
16
|
+
# {
|
|
17
|
+
# case PAYMENT:
|
|
18
|
+
# PaymentOp paymentOp;
|
|
19
|
+
# case CREATE_OFFER:
|
|
20
|
+
# CreateOfferOp createOfferOp;
|
|
21
|
+
# case SET_OPTIONS:
|
|
22
|
+
# SetOptionsOp setOptionsOp;
|
|
23
|
+
# case CHANGE_TRUST:
|
|
24
|
+
# ChangeTrustOp changeTrustOp;
|
|
25
|
+
# case ALLOW_TRUST:
|
|
26
|
+
# AllowTrustOp allowTrustOp;
|
|
27
|
+
# case ACCOUNT_MERGE:
|
|
28
|
+
# uint256 destination;
|
|
29
|
+
# case INFLATION:
|
|
30
|
+
# uint32 inflationSeq;
|
|
31
|
+
# }
|
|
32
|
+
# body;
|
|
33
|
+
# };
|
|
34
|
+
#
|
|
35
|
+
# ===========================================================================
|
|
36
|
+
module Stellar
|
|
37
|
+
class Operation < XDR::Struct
|
|
38
|
+
include XDR::Namespace
|
|
39
|
+
|
|
40
|
+
autoload :Body
|
|
41
|
+
|
|
42
|
+
attribute :source_account, XDR::Option[AccountID]
|
|
43
|
+
attribute :body, Body
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
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 (OperationType type)
|
|
9
|
+
# {
|
|
10
|
+
# case PAYMENT:
|
|
11
|
+
# PaymentResult paymentResult;
|
|
12
|
+
# case CREATE_OFFER:
|
|
13
|
+
# CreateOfferResult createOfferResult;
|
|
14
|
+
# case SET_OPTIONS:
|
|
15
|
+
# SetOptionsResult setOptionsResult;
|
|
16
|
+
# case CHANGE_TRUST:
|
|
17
|
+
# ChangeTrustResult changeTrustResult;
|
|
18
|
+
# case ALLOW_TRUST:
|
|
19
|
+
# AllowTrustResult allowTrustResult;
|
|
20
|
+
# case ACCOUNT_MERGE:
|
|
21
|
+
# AccountMergeResult accountMergeResult;
|
|
22
|
+
# case INFLATION:
|
|
23
|
+
# InflationResult inflationResult;
|
|
24
|
+
# }
|
|
25
|
+
#
|
|
26
|
+
# ===========================================================================
|
|
27
|
+
module Stellar
|
|
28
|
+
class OperationResult
|
|
29
|
+
class Tr < XDR::Union
|
|
30
|
+
switch_on OperationType, :type
|
|
31
|
+
|
|
32
|
+
switch :payment, :payment_result
|
|
33
|
+
switch :create_offer, :create_offer_result
|
|
34
|
+
switch :set_options, :set_options_result
|
|
35
|
+
switch :change_trust, :change_trust_result
|
|
36
|
+
switch :allow_trust, :allow_trust_result
|
|
37
|
+
switch :account_merge, :account_merge_result
|
|
38
|
+
switch :inflation, :inflation_result
|
|
39
|
+
|
|
40
|
+
attribute :payment_result, PaymentResult
|
|
41
|
+
attribute :create_offer_result, CreateOfferResult
|
|
42
|
+
attribute :set_options_result, SetOptionsResult
|
|
43
|
+
attribute :change_trust_result, ChangeTrustResult
|
|
44
|
+
attribute :allow_trust_result, AllowTrustResult
|
|
45
|
+
attribute :account_merge_result, AccountMergeResult
|
|
46
|
+
attribute :inflation_result, InflationResult
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
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 OperationResult switch (OperationResultCode code)
|
|
9
|
+
# {
|
|
10
|
+
# case opINNER:
|
|
11
|
+
# union switch (OperationType type)
|
|
12
|
+
# {
|
|
13
|
+
# case PAYMENT:
|
|
14
|
+
# PaymentResult paymentResult;
|
|
15
|
+
# case CREATE_OFFER:
|
|
16
|
+
# CreateOfferResult createOfferResult;
|
|
17
|
+
# case SET_OPTIONS:
|
|
18
|
+
# SetOptionsResult setOptionsResult;
|
|
19
|
+
# case CHANGE_TRUST:
|
|
20
|
+
# ChangeTrustResult changeTrustResult;
|
|
21
|
+
# case ALLOW_TRUST:
|
|
22
|
+
# AllowTrustResult allowTrustResult;
|
|
23
|
+
# case ACCOUNT_MERGE:
|
|
24
|
+
# AccountMergeResult accountMergeResult;
|
|
25
|
+
# case INFLATION:
|
|
26
|
+
# InflationResult inflationResult;
|
|
27
|
+
# }
|
|
28
|
+
# tr;
|
|
29
|
+
# default:
|
|
30
|
+
# void;
|
|
31
|
+
# };
|
|
32
|
+
#
|
|
33
|
+
# ===========================================================================
|
|
34
|
+
module Stellar
|
|
35
|
+
class OperationResult < XDR::Union
|
|
36
|
+
include XDR::Namespace
|
|
37
|
+
|
|
38
|
+
autoload :Tr
|
|
39
|
+
|
|
40
|
+
switch_on OperationResultCode, :code
|
|
41
|
+
|
|
42
|
+
switch :op_inner, :tr
|
|
43
|
+
switch :default
|
|
44
|
+
|
|
45
|
+
attribute :tr, Tr
|
|
46
|
+
end
|
|
47
|
+
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
|
+
# enum OperationResultCode
|
|
9
|
+
# {
|
|
10
|
+
# opINNER = 0, // inner object result is valid
|
|
11
|
+
#
|
|
12
|
+
# opBAD_AUTH = 1, // not enough signatures to perform operation
|
|
13
|
+
# opNO_ACCOUNT = 2 // source account was not found
|
|
14
|
+
# };
|
|
15
|
+
#
|
|
16
|
+
# ===========================================================================
|
|
17
|
+
module Stellar
|
|
18
|
+
class OperationResultCode < XDR::Enum
|
|
19
|
+
member :op_inner, 0
|
|
20
|
+
member :op_bad_auth, 1
|
|
21
|
+
member :op_no_account, 2
|
|
22
|
+
|
|
23
|
+
seal
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
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 OperationType
|
|
9
|
+
# {
|
|
10
|
+
# PAYMENT = 0,
|
|
11
|
+
# CREATE_OFFER = 1,
|
|
12
|
+
# SET_OPTIONS = 2,
|
|
13
|
+
# CHANGE_TRUST = 3,
|
|
14
|
+
# ALLOW_TRUST = 4,
|
|
15
|
+
# ACCOUNT_MERGE = 5,
|
|
16
|
+
# INFLATION = 6
|
|
17
|
+
# };
|
|
18
|
+
#
|
|
19
|
+
# ===========================================================================
|
|
20
|
+
module Stellar
|
|
21
|
+
class OperationType < XDR::Enum
|
|
22
|
+
member :payment, 0
|
|
23
|
+
member :create_offer, 1
|
|
24
|
+
member :set_options, 2
|
|
25
|
+
member :change_trust, 3
|
|
26
|
+
member :allow_trust, 4
|
|
27
|
+
member :account_merge, 5
|
|
28
|
+
member :inflation, 6
|
|
29
|
+
|
|
30
|
+
seal
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -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 PaymentOp
|
|
9
|
+
# {
|
|
10
|
+
# AccountID destination; // recipient of the payment
|
|
11
|
+
# Currency currency; // what they end up with
|
|
12
|
+
# int64 amount; // amount they end up with
|
|
13
|
+
#
|
|
14
|
+
# opaque memo<32>;
|
|
15
|
+
# opaque sourceMemo<32>; // used to return a payment
|
|
16
|
+
#
|
|
17
|
+
# // payment over path
|
|
18
|
+
# Currency path<5>; // what hops it must go through to get there
|
|
19
|
+
# int64 sendMax; // the maximum amount of the source currency (==path[0]) to
|
|
20
|
+
# // send (excluding fees).
|
|
21
|
+
# // The operation will fail if can't be met
|
|
22
|
+
# };
|
|
23
|
+
#
|
|
24
|
+
# ===========================================================================
|
|
25
|
+
module Stellar
|
|
26
|
+
class PaymentOp < XDR::Struct
|
|
27
|
+
attribute :destination, AccountID
|
|
28
|
+
attribute :currency, Currency
|
|
29
|
+
attribute :amount, Int64
|
|
30
|
+
attribute :memo, XDR::VarOpaque[32]
|
|
31
|
+
attribute :source_memo, XDR::VarOpaque[32]
|
|
32
|
+
attribute :path, XDR::VarArray[Currency, 5]
|
|
33
|
+
attribute :send_max, Int64
|
|
34
|
+
end
|
|
35
|
+
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 PaymentResult switch (PaymentResultCode code)
|
|
9
|
+
# {
|
|
10
|
+
# case PAYMENT_SUCCESS:
|
|
11
|
+
# void;
|
|
12
|
+
# case PAYMENT_SUCCESS_MULTI:
|
|
13
|
+
# PaymentSuccessMultiResult multi;
|
|
14
|
+
# default:
|
|
15
|
+
# void;
|
|
16
|
+
# };
|
|
17
|
+
#
|
|
18
|
+
# ===========================================================================
|
|
19
|
+
module Stellar
|
|
20
|
+
class PaymentResult < XDR::Union
|
|
21
|
+
switch_on PaymentResultCode, :code
|
|
22
|
+
|
|
23
|
+
switch :payment_success
|
|
24
|
+
switch :payment_success_multi, :multi
|
|
25
|
+
switch :default
|
|
26
|
+
|
|
27
|
+
attribute :multi, PaymentSuccessMultiResult
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 PaymentResultCode
|
|
9
|
+
# {
|
|
10
|
+
# // codes considered as "success" for the operation
|
|
11
|
+
# PAYMENT_SUCCESS = 0, // simple payment success
|
|
12
|
+
# PAYMENT_SUCCESS_MULTI = 1, // multi-path payment success
|
|
13
|
+
#
|
|
14
|
+
# // codes considered as "failure" for the operation
|
|
15
|
+
# PAYMENT_UNDERFUNDED = 2, // not enough funds in source account
|
|
16
|
+
# PAYMENT_NO_DESTINATION = 3, // destination account does not exist
|
|
17
|
+
# PAYMENT_NO_TRUST = 4, // destination missing a trust line for currency
|
|
18
|
+
# PAYMENT_NOT_AUTHORIZED = 5, // destination not authorized to hold currency
|
|
19
|
+
# PAYMENT_LINE_FULL = 6, // destination would go above their limit
|
|
20
|
+
# PAYMENT_TOO_FEW_OFFERS = 7, // not enough offers to satisfy path payment
|
|
21
|
+
# PAYMENT_OVER_SENDMAX = 8, // multi-path payment could not satisfy sendmax
|
|
22
|
+
# PAYMENT_LOW_RESERVE = 9 // would create an account below the min reserve
|
|
23
|
+
# };
|
|
24
|
+
#
|
|
25
|
+
# ===========================================================================
|
|
26
|
+
module Stellar
|
|
27
|
+
class PaymentResultCode < XDR::Enum
|
|
28
|
+
member :payment_success, 0
|
|
29
|
+
member :payment_success_multi, 1
|
|
30
|
+
member :payment_underfunded, 2
|
|
31
|
+
member :payment_no_destination, 3
|
|
32
|
+
member :payment_no_trust, 4
|
|
33
|
+
member :payment_not_authorized, 5
|
|
34
|
+
member :payment_line_full, 6
|
|
35
|
+
member :payment_too_few_offers, 7
|
|
36
|
+
member :payment_over_sendmax, 8
|
|
37
|
+
member :payment_low_reserve, 9
|
|
38
|
+
|
|
39
|
+
seal
|
|
40
|
+
end
|
|
41
|
+
end
|