stellar-base 0.18.0 → 0.23.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +2 -3
- data/generated/stellar-base-generated.rb +45 -8
- data/generated/stellar/allow_trust_op.rb +5 -4
- data/generated/stellar/allow_trust_op/asset.rb +4 -4
- data/generated/stellar/asset.rb +2 -2
- data/generated/stellar/asset/alpha_num12.rb +2 -2
- data/generated/stellar/asset/alpha_num4.rb +2 -2
- data/generated/stellar/authenticated_message.rb +4 -4
- data/generated/stellar/authenticated_message/v0.rb +4 -4
- data/generated/stellar/bucket_entry.rb +6 -0
- data/generated/stellar/bucket_entry_type.rb +8 -2
- data/generated/stellar/bucket_metadata.rb +32 -0
- data/generated/stellar/bucket_metadata/ext.rb +24 -0
- data/generated/stellar/claim_offer_atom.rb +2 -2
- data/generated/stellar/{create_passive_offer_op.rb → create_passive_sell_offer_op.rb} +2 -2
- data/generated/stellar/crypto_key_type.rb +8 -4
- data/generated/stellar/curve25519_public.rb +1 -1
- data/generated/stellar/curve25519_secret.rb +1 -1
- data/generated/stellar/envelope_type.rb +10 -4
- data/generated/stellar/fee_bump_transaction.rb +39 -0
- data/generated/stellar/fee_bump_transaction/ext.rb +24 -0
- data/generated/stellar/fee_bump_transaction/inner_tx.rb +25 -0
- data/generated/stellar/fee_bump_transaction_envelope.rb +22 -0
- data/generated/stellar/hmac_sha256_key.rb +1 -1
- data/generated/stellar/hmac_sha256_mac.rb +1 -1
- data/generated/stellar/inner_transaction_result.rb +56 -0
- data/generated/stellar/inner_transaction_result/ext.rb +24 -0
- data/generated/stellar/inner_transaction_result/result.rb +52 -0
- data/generated/stellar/inner_transaction_result_pair.rb +20 -0
- data/generated/stellar/ledger_close_meta.rb +23 -0
- data/generated/stellar/ledger_close_meta_v0.rb +35 -0
- data/generated/stellar/ledger_close_value_signature.rb +20 -0
- data/generated/stellar/ledger_key.rb +1 -1
- data/generated/stellar/ledger_key/offer.rb +2 -2
- data/generated/stellar/manage_buy_offer_op.rb +29 -0
- data/generated/stellar/{manage_offer_result.rb → manage_buy_offer_result.rb} +5 -5
- data/generated/stellar/manage_buy_offer_result_code.rb +51 -0
- data/generated/stellar/{manage_offer_op.rb → manage_sell_offer_op.rb} +4 -4
- data/generated/stellar/manage_sell_offer_result.rb +26 -0
- data/generated/stellar/manage_sell_offer_result_code.rb +54 -0
- data/generated/stellar/message_type.rb +6 -1
- data/generated/stellar/muxed_account.rb +35 -0
- data/generated/stellar/muxed_account/med25519.rb +22 -0
- data/generated/stellar/offer_entry.rb +2 -2
- data/generated/stellar/operation.rb +13 -9
- data/generated/stellar/operation/body.rb +37 -29
- data/generated/stellar/operation_result.rb +10 -6
- data/generated/stellar/operation_result/tr.rb +38 -30
- data/generated/stellar/operation_result_code.rb +11 -7
- data/generated/stellar/operation_type.rb +20 -16
- data/generated/stellar/{path_payment_op.rb → path_payment_strict_receive_op.rb} +6 -6
- data/generated/stellar/path_payment_strict_receive_result.rb +38 -0
- data/generated/stellar/path_payment_strict_receive_result/success.rb +22 -0
- data/generated/stellar/path_payment_strict_receive_result_code.rb +56 -0
- data/generated/stellar/path_payment_strict_send_op.rb +32 -0
- data/generated/stellar/{path_payment_result.rb → path_payment_strict_send_result.rb} +7 -7
- data/generated/stellar/{path_payment_result → path_payment_strict_send_result}/success.rb +1 -1
- data/generated/stellar/path_payment_strict_send_result_code.rb +55 -0
- data/generated/stellar/payment_op.rb +4 -4
- data/generated/stellar/peer_stats.rb +48 -0
- data/generated/stellar/signed_survey_request_message.rb +20 -0
- data/generated/stellar/signed_survey_response_message.rb +20 -0
- data/generated/stellar/signer.rb +1 -1
- data/generated/stellar/stellar_message.rb +22 -12
- data/generated/stellar/stellar_value.rb +7 -5
- data/generated/stellar/stellar_value/ext.rb +8 -4
- data/generated/stellar/stellar_value_type.rb +22 -0
- data/generated/stellar/survey_message_command_type.rb +20 -0
- data/generated/stellar/survey_request_message.rb +26 -0
- data/generated/stellar/survey_response_body.rb +23 -0
- data/generated/stellar/survey_response_message.rb +26 -0
- data/generated/stellar/time_bounds.rb +4 -4
- data/generated/stellar/topology_response_body.rb +25 -0
- data/generated/stellar/transaction.rb +4 -4
- data/generated/stellar/transaction_envelope.rb +17 -8
- data/generated/stellar/transaction_meta.rb +4 -0
- data/generated/stellar/transaction_meta_v1.rb +1 -1
- data/generated/stellar/transaction_meta_v2.rb +24 -0
- data/generated/stellar/transaction_result.rb +3 -0
- data/generated/stellar/transaction_result/result.rb +9 -3
- data/generated/stellar/transaction_result_code.rb +21 -14
- data/generated/stellar/transaction_result_meta.rb +22 -0
- data/generated/stellar/transaction_signature_payload.rb +3 -1
- data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +7 -3
- data/generated/stellar/transaction_v0.rb +39 -0
- data/generated/stellar/transaction_v0/ext.rb +24 -0
- data/generated/stellar/transaction_v0_envelope.rb +22 -0
- data/generated/stellar/transaction_v1_envelope.rb +22 -0
- data/generated/stellar/trust_line_flags.rb +6 -2
- data/generated/stellar/upgrade_entry_meta.rb +20 -0
- data/lib/stellar-base.rb +28 -23
- data/lib/stellar/account_flags.rb +2 -4
- data/lib/stellar/asset.rb +6 -6
- data/lib/stellar/base.rb +1 -1
- data/lib/stellar/compat.rb +21 -0
- data/lib/stellar/concerns/transaction.rb +49 -0
- data/lib/stellar/convert.rb +2 -2
- data/lib/stellar/factories.rb +1 -3
- data/lib/stellar/fee_bump_transaction.rb +21 -0
- data/lib/stellar/key_pair.rb +9 -6
- data/lib/stellar/networks.rb +5 -7
- data/lib/stellar/operation.rb +428 -317
- data/lib/stellar/{path_payment_result.rb → path_payment_strict_receive_result.rb} +2 -3
- data/lib/stellar/price.rb +2 -4
- data/lib/stellar/signer_key.rb +4 -8
- data/lib/stellar/thresholds.rb +5 -7
- data/lib/stellar/transaction.rb +154 -169
- data/lib/stellar/transaction_builder.rb +149 -0
- data/lib/stellar/transaction_envelope.rb +40 -8
- data/lib/stellar/transaction_v0.rb +39 -0
- data/lib/stellar/util/continued_fraction.rb +19 -19
- data/lib/stellar/util/strkey.rb +39 -14
- data/lib/stellar/{base/version.rb → version.rb} +1 -1
- metadata +69 -211
- data/.gitignore +0 -17
- data/.travis.yml +0 -14
- data/.yardopts +0 -8
- data/CHANGELOG.md +0 -120
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -15
- data/Guardfile +0 -5
- data/Rakefile +0 -4
- data/examples/create_account.rb +0 -26
- data/examples/low_level_transaction_post.rb +0 -46
- data/examples/mid_level_transaction_post.rb +0 -33
- data/examples/non_native_payment.rb +0 -60
- data/examples/offer.rb +0 -75
- data/examples/transaction_merge.rb +0 -23
- data/generated/stellar/manage_offer_result_code.rb +0 -50
- data/generated/stellar/path_payment_result_code.rb +0 -47
- data/ruby-stellar-base.gemspec +0 -34
- data/spec/lib/stellar/account_flags_spec.rb +0 -19
- data/spec/lib/stellar/asset_spec.rb +0 -45
- data/spec/lib/stellar/convert_spec.rb +0 -61
- data/spec/lib/stellar/key_pair_spec.rb +0 -251
- data/spec/lib/stellar/networks_spec.rb +0 -77
- data/spec/lib/stellar/operation_spec.rb +0 -71
- data/spec/lib/stellar/path_payment_result_spec.rb +0 -95
- data/spec/lib/stellar/price_spec.rb +0 -34
- data/spec/lib/stellar/signer_key_spec.rb +0 -26
- data/spec/lib/stellar/thresholds_spec.rb +0 -62
- data/spec/lib/stellar/transaction_envelope_spec.rb +0 -93
- data/spec/lib/stellar/transaction_spec.rb +0 -100
- data/spec/lib/stellar/util/strkey_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -16
- data/spec/support/matchers/be_strkey.rb +0 -9
- data/spec/support/matchers/eq_bytes.rb +0 -5
- data/spec/support/matchers/have_length.rb +0 -5
- data/tasks/rspec.rake +0 -6
- data/tasks/travis.rake +0 -1
- data/tasks/xdr.rake +0 -50
- data/xdr/Stellar-SCP.x +0 -86
- data/xdr/Stellar-ledger-entries.x +0 -288
- data/xdr/Stellar-ledger.x +0 -283
- data/xdr/Stellar-overlay.x +0 -146
- data/xdr/Stellar-transaction.x +0 -777
- data/xdr/Stellar-types.x +0 -81
@@ -11,6 +11,8 @@ require 'xdr'
|
|
11
11
|
# OperationMeta operations<>;
|
12
12
|
# case 1:
|
13
13
|
# TransactionMetaV1 v1;
|
14
|
+
# case 2:
|
15
|
+
# TransactionMetaV2 v2;
|
14
16
|
# };
|
15
17
|
#
|
16
18
|
# ===========================================================================
|
@@ -20,8 +22,10 @@ module Stellar
|
|
20
22
|
|
21
23
|
switch 0, :operations
|
22
24
|
switch 1, :v1
|
25
|
+
switch 2, :v2
|
23
26
|
|
24
27
|
attribute :operations, XDR::VarArray[OperationMeta]
|
25
28
|
attribute :v1, TransactionMetaV1
|
29
|
+
attribute :v2, TransactionMetaV2
|
26
30
|
end
|
27
31
|
end
|
@@ -8,7 +8,7 @@ require 'xdr'
|
|
8
8
|
# struct TransactionMetaV1
|
9
9
|
# {
|
10
10
|
# LedgerEntryChanges txChanges; // tx level changes if any
|
11
|
-
# OperationMeta operations<>;
|
11
|
+
# OperationMeta operations<>; // meta for each operation
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct TransactionMetaV2
|
9
|
+
# {
|
10
|
+
# LedgerEntryChanges txChangesBefore; // tx level changes before operations
|
11
|
+
# // are applied if any
|
12
|
+
# OperationMeta operations<>; // meta for each operation
|
13
|
+
# LedgerEntryChanges txChangesAfter; // tx level changes after operations are
|
14
|
+
# // applied if any
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class TransactionMetaV2 < XDR::Struct
|
20
|
+
attribute :tx_changes_before, LedgerEntryChanges
|
21
|
+
attribute :operations, XDR::VarArray[OperationMeta]
|
22
|
+
attribute :tx_changes_after, LedgerEntryChanges
|
23
|
+
end
|
24
|
+
end
|
@@ -11,6 +11,9 @@ require 'xdr'
|
|
11
11
|
#
|
12
12
|
# union switch (TransactionResultCode code)
|
13
13
|
# {
|
14
|
+
# case txFEE_BUMP_INNER_SUCCESS:
|
15
|
+
# case txFEE_BUMP_INNER_FAILED:
|
16
|
+
# InnerTransactionResultPair innerResultPair;
|
14
17
|
# case txSUCCESS:
|
15
18
|
# case txFAILED:
|
16
19
|
# OperationResult results<>;
|
@@ -7,6 +7,9 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# union switch (TransactionResultCode code)
|
9
9
|
# {
|
10
|
+
# case txFEE_BUMP_INNER_SUCCESS:
|
11
|
+
# case txFEE_BUMP_INNER_FAILED:
|
12
|
+
# InnerTransactionResultPair innerResultPair;
|
10
13
|
# case txSUCCESS:
|
11
14
|
# case txFAILED:
|
12
15
|
# OperationResult results<>;
|
@@ -20,11 +23,14 @@ module Stellar
|
|
20
23
|
class Result < XDR::Union
|
21
24
|
switch_on TransactionResultCode, :code
|
22
25
|
|
23
|
-
switch :
|
24
|
-
switch :
|
26
|
+
switch :tx_fee_bump_inner_success, :inner_result_pair
|
27
|
+
switch :tx_fee_bump_inner_failed, :inner_result_pair
|
28
|
+
switch :tx_success, :results
|
29
|
+
switch :tx_failed, :results
|
25
30
|
switch :default
|
26
31
|
|
27
|
-
attribute :
|
32
|
+
attribute :inner_result_pair, InnerTransactionResultPair
|
33
|
+
attribute :results, XDR::VarArray[OperationResult]
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
@@ -7,7 +7,8 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# enum TransactionResultCode
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded
|
11
|
+
# txSUCCESS = 0, // all operations succeeded
|
11
12
|
#
|
12
13
|
# txFAILED = -1, // one of the operations failed (none were applied)
|
13
14
|
#
|
@@ -21,24 +22,30 @@ require 'xdr'
|
|
21
22
|
# txNO_ACCOUNT = -8, // source account not found
|
22
23
|
# txINSUFFICIENT_FEE = -9, // fee is too small
|
23
24
|
# txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
|
24
|
-
# txINTERNAL_ERROR = -11
|
25
|
+
# txINTERNAL_ERROR = -11, // an unknown error occured
|
26
|
+
#
|
27
|
+
# txNOT_SUPPORTED = -12, // transaction type not supported
|
28
|
+
# txFEE_BUMP_INNER_FAILED = -13 // fee bump inner transaction failed
|
25
29
|
# };
|
26
30
|
#
|
27
31
|
# ===========================================================================
|
28
32
|
module Stellar
|
29
33
|
class TransactionResultCode < XDR::Enum
|
30
|
-
member :
|
31
|
-
member :
|
32
|
-
member :
|
33
|
-
member :
|
34
|
-
member :
|
35
|
-
member :
|
36
|
-
member :
|
37
|
-
member :
|
38
|
-
member :
|
39
|
-
member :
|
40
|
-
member :
|
41
|
-
member :
|
34
|
+
member :tx_fee_bump_inner_success, 1
|
35
|
+
member :tx_success, 0
|
36
|
+
member :tx_failed, -1
|
37
|
+
member :tx_too_early, -2
|
38
|
+
member :tx_too_late, -3
|
39
|
+
member :tx_missing_operation, -4
|
40
|
+
member :tx_bad_seq, -5
|
41
|
+
member :tx_bad_auth, -6
|
42
|
+
member :tx_insufficient_balance, -7
|
43
|
+
member :tx_no_account, -8
|
44
|
+
member :tx_insufficient_fee, -9
|
45
|
+
member :tx_bad_auth_extra, -10
|
46
|
+
member :tx_internal_error, -11
|
47
|
+
member :tx_not_supported, -12
|
48
|
+
member :tx_fee_bump_inner_failed, -13
|
42
49
|
|
43
50
|
seal
|
44
51
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct TransactionResultMeta
|
9
|
+
# {
|
10
|
+
# TransactionResultPair result;
|
11
|
+
# LedgerEntryChanges feeProcessing;
|
12
|
+
# TransactionMeta txApplyProcessing;
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class TransactionResultMeta < XDR::Struct
|
18
|
+
attribute :result, TransactionResultPair
|
19
|
+
attribute :fee_processing, LedgerEntryChanges
|
20
|
+
attribute :tx_apply_processing, TransactionMeta
|
21
|
+
end
|
22
|
+
end
|
@@ -10,9 +10,11 @@ require 'xdr'
|
|
10
10
|
# Hash networkId;
|
11
11
|
# union switch (EnvelopeType type)
|
12
12
|
# {
|
13
|
+
# // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0
|
13
14
|
# case ENVELOPE_TYPE_TX:
|
14
15
|
# Transaction tx;
|
15
|
-
#
|
16
|
+
# case ENVELOPE_TYPE_TX_FEE_BUMP:
|
17
|
+
# FeeBumpTransaction feeBump;
|
16
18
|
# }
|
17
19
|
# taggedTransaction;
|
18
20
|
# };
|
@@ -7,9 +7,11 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# union switch (EnvelopeType type)
|
9
9
|
# {
|
10
|
+
# // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0
|
10
11
|
# case ENVELOPE_TYPE_TX:
|
11
12
|
# Transaction tx;
|
12
|
-
#
|
13
|
+
# case ENVELOPE_TYPE_TX_FEE_BUMP:
|
14
|
+
# FeeBumpTransaction feeBump;
|
13
15
|
# }
|
14
16
|
#
|
15
17
|
# ===========================================================================
|
@@ -18,9 +20,11 @@ module Stellar
|
|
18
20
|
class TaggedTransaction < XDR::Union
|
19
21
|
switch_on EnvelopeType, :type
|
20
22
|
|
21
|
-
switch :envelope_type_tx,
|
23
|
+
switch :envelope_type_tx, :tx
|
24
|
+
switch :envelope_type_tx_fee_bump, :fee_bump
|
22
25
|
|
23
|
-
attribute :tx,
|
26
|
+
attribute :tx, Transaction
|
27
|
+
attribute :fee_bump, FeeBumpTransaction
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -0,0 +1,39 @@
|
|
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 TransactionV0
|
9
|
+
# {
|
10
|
+
# uint256 sourceAccountEd25519;
|
11
|
+
# uint32 fee;
|
12
|
+
# SequenceNumber seqNum;
|
13
|
+
# TimeBounds* timeBounds;
|
14
|
+
# Memo memo;
|
15
|
+
# Operation operations<MAX_OPS_PER_TX>;
|
16
|
+
# union switch (int v)
|
17
|
+
# {
|
18
|
+
# case 0:
|
19
|
+
# void;
|
20
|
+
# }
|
21
|
+
# ext;
|
22
|
+
# };
|
23
|
+
#
|
24
|
+
# ===========================================================================
|
25
|
+
module Stellar
|
26
|
+
class TransactionV0 < XDR::Struct
|
27
|
+
include XDR::Namespace
|
28
|
+
|
29
|
+
autoload :Ext
|
30
|
+
|
31
|
+
attribute :source_account_ed25519, Uint256
|
32
|
+
attribute :fee, Uint32
|
33
|
+
attribute :seq_num, SequenceNumber
|
34
|
+
attribute :time_bounds, XDR::Option[TimeBounds]
|
35
|
+
attribute :memo, Memo
|
36
|
+
attribute :operations, XDR::VarArray[Operation, MAX_OPS_PER_TX]
|
37
|
+
attribute :ext, Ext
|
38
|
+
end
|
39
|
+
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 TransactionV0
|
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,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct TransactionV0Envelope
|
9
|
+
# {
|
10
|
+
# TransactionV0 tx;
|
11
|
+
# /* Each decorated signature is a signature over the SHA256 hash of
|
12
|
+
# * a TransactionSignaturePayload */
|
13
|
+
# DecoratedSignature signatures<20>;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class TransactionV0Envelope < XDR::Struct
|
19
|
+
attribute :tx, TransactionV0
|
20
|
+
attribute :signatures, XDR::VarArray[DecoratedSignature, 20]
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct TransactionV1Envelope
|
9
|
+
# {
|
10
|
+
# Transaction tx;
|
11
|
+
# /* Each decorated signature is a signature over the SHA256 hash of
|
12
|
+
# * a TransactionSignaturePayload */
|
13
|
+
# DecoratedSignature signatures<20>;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class TransactionV1Envelope < XDR::Struct
|
19
|
+
attribute :tx, Transaction
|
20
|
+
attribute :signatures, XDR::VarArray[DecoratedSignature, 20]
|
21
|
+
end
|
22
|
+
end
|
@@ -8,13 +8,17 @@ require 'xdr'
|
|
8
8
|
# enum TrustLineFlags
|
9
9
|
# {
|
10
10
|
# // issuer has authorized account to perform transactions with its credit
|
11
|
-
# AUTHORIZED_FLAG = 1
|
11
|
+
# AUTHORIZED_FLAG = 1,
|
12
|
+
# // issuer has authorized account to maintain and reduce liabilities for its
|
13
|
+
# // credit
|
14
|
+
# AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2
|
12
15
|
# };
|
13
16
|
#
|
14
17
|
# ===========================================================================
|
15
18
|
module Stellar
|
16
19
|
class TrustLineFlags < XDR::Enum
|
17
|
-
member :authorized_flag,
|
20
|
+
member :authorized_flag, 1
|
21
|
+
member :authorized_to_maintain_liabilities_flag, 2
|
18
22
|
|
19
23
|
seal
|
20
24
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct UpgradeEntryMeta
|
9
|
+
# {
|
10
|
+
# LedgerUpgrade upgrade;
|
11
|
+
# LedgerEntryChanges changes;
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class UpgradeEntryMeta < XDR::Struct
|
17
|
+
attribute :upgrade, LedgerUpgrade
|
18
|
+
attribute :changes, LedgerEntryChanges
|
19
|
+
end
|
20
|
+
end
|
data/lib/stellar-base.rb
CHANGED
@@ -1,33 +1,38 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
1
|
+
require "xdr"
|
2
|
+
require "rbnacl"
|
3
|
+
require "digest/sha2"
|
4
|
+
require "active_support/core_ext/object/blank"
|
5
|
+
require "active_support/core_ext/enumerable"
|
6
|
+
require "active_support/core_ext/kernel/reporting"
|
7
7
|
|
8
8
|
# See ../generated for code-gen'ed files
|
9
9
|
silence_warnings do
|
10
|
-
require
|
10
|
+
require "stellar-base-generated"
|
11
11
|
end
|
12
12
|
Stellar.load_all!
|
13
13
|
|
14
14
|
Stellar::ONE = 1_0000000
|
15
15
|
|
16
|
-
|
17
16
|
# extensions onto the generated files must be loaded manually, below
|
18
17
|
|
19
|
-
require_relative
|
20
|
-
require_relative
|
21
|
-
require_relative
|
22
|
-
require_relative
|
23
|
-
require_relative
|
24
|
-
require_relative
|
25
|
-
require_relative
|
26
|
-
require_relative
|
27
|
-
require_relative
|
28
|
-
require_relative
|
29
|
-
require_relative
|
30
|
-
require_relative
|
31
|
-
require_relative
|
32
|
-
require_relative
|
33
|
-
require_relative
|
18
|
+
require_relative "./stellar/account_flags"
|
19
|
+
require_relative "./stellar/asset"
|
20
|
+
require_relative "./stellar/key_pair"
|
21
|
+
require_relative "./stellar/operation"
|
22
|
+
require_relative "./stellar/path_payment_strict_receive_result"
|
23
|
+
require_relative "./stellar/price"
|
24
|
+
require_relative "./stellar/signer_key"
|
25
|
+
require_relative "./stellar/thresholds"
|
26
|
+
require_relative "./stellar/concerns/transaction"
|
27
|
+
require_relative "./stellar/transaction"
|
28
|
+
require_relative "./stellar/transaction_v0"
|
29
|
+
require_relative "./stellar/fee_bump_transaction"
|
30
|
+
require_relative "./stellar/transaction_builder"
|
31
|
+
require_relative "./stellar/transaction_envelope"
|
32
|
+
require_relative "./stellar/util/strkey"
|
33
|
+
require_relative "./stellar/util/continued_fraction"
|
34
|
+
require_relative "./stellar/convert"
|
35
|
+
require_relative "./stellar/networks"
|
36
|
+
require_relative "./stellar/version"
|
37
|
+
|
38
|
+
require_relative "./stellar/compat"
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module Stellar
|
2
2
|
class AccountFlags
|
3
|
-
|
4
|
-
|
5
3
|
#
|
6
4
|
# Converts an array of Stellar::AccountFlags members into
|
7
5
|
# an Integer suitable for use in a SetOptionsOp.
|
@@ -9,7 +7,7 @@ module Stellar
|
|
9
7
|
# @param flags=nil [Array<Stellar::AccountFlags>] the flags to combine
|
10
8
|
#
|
11
9
|
# @return [Fixnum] the combined result
|
12
|
-
def self.make_mask(flags=nil)
|
10
|
+
def self.make_mask(flags = nil)
|
13
11
|
flags ||= []
|
14
12
|
|
15
13
|
flags.map(&:value).inject(&:|) || 0
|
@@ -22,7 +20,7 @@ module Stellar
|
|
22
20
|
# @param combined [Fixnum]
|
23
21
|
# @return [Array<Stellar::AccountFlags>]
|
24
22
|
def self.parse_mask(combined)
|
25
|
-
members.values.select{|m| (m.value & combined) != 0}
|
23
|
+
members.values.select { |m| (m.value & combined) != 0 }
|
26
24
|
end
|
27
25
|
end
|
28
26
|
end
|