stellar-base 0.20.0 → 0.23.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -21
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +2 -3
- data/generated/stellar-base-generated.rb +31 -4
- data/generated/stellar/allow_trust_op.rb +3 -2
- data/generated/stellar/authenticated_message.rb +4 -4
- data/generated/stellar/authenticated_message/v0.rb +4 -4
- data/generated/stellar/change_trust_result_code.rb +1 -1
- 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 +9 -5
- 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/manage_buy_offer_result_code.rb +5 -4
- data/generated/stellar/manage_sell_offer_result_code.rb +12 -8
- 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/operation.rb +7 -5
- data/generated/stellar/operation/body.rb +31 -27
- data/generated/stellar/operation_result.rb +5 -3
- data/generated/stellar/operation_result/tr.rb +33 -29
- data/generated/stellar/operation_result_code.rb +3 -3
- data/generated/stellar/operation_type.rb +17 -15
- 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/stellar_message.rb +22 -12
- 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/topology_response_body.rb +25 -0
- data/generated/stellar/transaction.rb +2 -2
- data/generated/stellar/transaction_envelope.rb +17 -8
- data/generated/stellar/transaction_meta.rb +4 -0
- 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 +27 -24
- 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/{base/compat.rb → compat.rb} +6 -7
- 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 +427 -336
- 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 -175
- 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 +61 -211
- data/.gitignore +0 -17
- data/.travis.yml +0 -16
- data/.yardopts +0 -8
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -15
- data/Guardfile +0 -5
- data/Rakefile +0 -4
- data/examples/allow_trust.rb +0 -51
- 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/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 -45
- data/xdr/Stellar-SCP.x +0 -86
- data/xdr/Stellar-ledger-entries.x +0 -295
- data/xdr/Stellar-ledger.x +0 -318
- data/xdr/Stellar-overlay.x +0 -146
- data/xdr/Stellar-transaction.x +0 -834
- data/xdr/Stellar-types.x +0 -81
@@ -10,7 +10,7 @@ require 'xdr'
|
|
10
10
|
# // sourceAccount is the account used to run the operation
|
11
11
|
# // if not set, the runtime defaults to "sourceAccount" specified at
|
12
12
|
# // the transaction level
|
13
|
-
#
|
13
|
+
# MuxedAccount* sourceAccount;
|
14
14
|
#
|
15
15
|
# union switch (OperationType type)
|
16
16
|
# {
|
@@ -18,8 +18,8 @@ require 'xdr'
|
|
18
18
|
# CreateAccountOp createAccountOp;
|
19
19
|
# case PAYMENT:
|
20
20
|
# PaymentOp paymentOp;
|
21
|
-
# case
|
22
|
-
#
|
21
|
+
# case PATH_PAYMENT_STRICT_RECEIVE:
|
22
|
+
# PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp;
|
23
23
|
# case MANAGE_SELL_OFFER:
|
24
24
|
# ManageSellOfferOp manageSellOfferOp;
|
25
25
|
# case CREATE_PASSIVE_SELL_OFFER:
|
@@ -31,7 +31,7 @@ require 'xdr'
|
|
31
31
|
# case ALLOW_TRUST:
|
32
32
|
# AllowTrustOp allowTrustOp;
|
33
33
|
# case ACCOUNT_MERGE:
|
34
|
-
#
|
34
|
+
# MuxedAccount destination;
|
35
35
|
# case INFLATION:
|
36
36
|
# void;
|
37
37
|
# case MANAGE_DATA:
|
@@ -40,6 +40,8 @@ require 'xdr'
|
|
40
40
|
# BumpSequenceOp bumpSequenceOp;
|
41
41
|
# case MANAGE_BUY_OFFER:
|
42
42
|
# ManageBuyOfferOp manageBuyOfferOp;
|
43
|
+
# case PATH_PAYMENT_STRICT_SEND:
|
44
|
+
# PathPaymentStrictSendOp pathPaymentStrictSendOp;
|
43
45
|
# }
|
44
46
|
# body;
|
45
47
|
# };
|
@@ -51,7 +53,7 @@ module Stellar
|
|
51
53
|
|
52
54
|
autoload :Body
|
53
55
|
|
54
|
-
attribute :source_account, XDR::Option[
|
56
|
+
attribute :source_account, XDR::Option[MuxedAccount]
|
55
57
|
attribute :body, Body
|
56
58
|
end
|
57
59
|
end
|
@@ -11,8 +11,8 @@ require 'xdr'
|
|
11
11
|
# CreateAccountOp createAccountOp;
|
12
12
|
# case PAYMENT:
|
13
13
|
# PaymentOp paymentOp;
|
14
|
-
# case
|
15
|
-
#
|
14
|
+
# case PATH_PAYMENT_STRICT_RECEIVE:
|
15
|
+
# PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp;
|
16
16
|
# case MANAGE_SELL_OFFER:
|
17
17
|
# ManageSellOfferOp manageSellOfferOp;
|
18
18
|
# case CREATE_PASSIVE_SELL_OFFER:
|
@@ -24,7 +24,7 @@ require 'xdr'
|
|
24
24
|
# case ALLOW_TRUST:
|
25
25
|
# AllowTrustOp allowTrustOp;
|
26
26
|
# case ACCOUNT_MERGE:
|
27
|
-
#
|
27
|
+
# MuxedAccount destination;
|
28
28
|
# case INFLATION:
|
29
29
|
# void;
|
30
30
|
# case MANAGE_DATA:
|
@@ -33,6 +33,8 @@ require 'xdr'
|
|
33
33
|
# BumpSequenceOp bumpSequenceOp;
|
34
34
|
# case MANAGE_BUY_OFFER:
|
35
35
|
# ManageBuyOfferOp manageBuyOfferOp;
|
36
|
+
# case PATH_PAYMENT_STRICT_SEND:
|
37
|
+
# PathPaymentStrictSendOp pathPaymentStrictSendOp;
|
36
38
|
# }
|
37
39
|
#
|
38
40
|
# ===========================================================================
|
@@ -41,32 +43,34 @@ module Stellar
|
|
41
43
|
class Body < XDR::Union
|
42
44
|
switch_on OperationType, :type
|
43
45
|
|
44
|
-
switch :create_account,
|
45
|
-
switch :payment,
|
46
|
-
switch :
|
47
|
-
switch :manage_sell_offer,
|
48
|
-
switch :create_passive_sell_offer,
|
49
|
-
switch :set_options,
|
50
|
-
switch :change_trust,
|
51
|
-
switch :allow_trust,
|
52
|
-
switch :account_merge,
|
46
|
+
switch :create_account, :create_account_op
|
47
|
+
switch :payment, :payment_op
|
48
|
+
switch :path_payment_strict_receive, :path_payment_strict_receive_op
|
49
|
+
switch :manage_sell_offer, :manage_sell_offer_op
|
50
|
+
switch :create_passive_sell_offer, :create_passive_sell_offer_op
|
51
|
+
switch :set_options, :set_options_op
|
52
|
+
switch :change_trust, :change_trust_op
|
53
|
+
switch :allow_trust, :allow_trust_op
|
54
|
+
switch :account_merge, :destination
|
53
55
|
switch :inflation
|
54
|
-
switch :manage_data,
|
55
|
-
switch :bump_sequence,
|
56
|
-
switch :manage_buy_offer,
|
56
|
+
switch :manage_data, :manage_data_op
|
57
|
+
switch :bump_sequence, :bump_sequence_op
|
58
|
+
switch :manage_buy_offer, :manage_buy_offer_op
|
59
|
+
switch :path_payment_strict_send, :path_payment_strict_send_op
|
57
60
|
|
58
|
-
attribute :create_account_op,
|
59
|
-
attribute :payment_op,
|
60
|
-
attribute :
|
61
|
-
attribute :manage_sell_offer_op,
|
62
|
-
attribute :create_passive_sell_offer_op,
|
63
|
-
attribute :set_options_op,
|
64
|
-
attribute :change_trust_op,
|
65
|
-
attribute :allow_trust_op,
|
66
|
-
attribute :destination,
|
67
|
-
attribute :manage_data_op,
|
68
|
-
attribute :bump_sequence_op,
|
69
|
-
attribute :manage_buy_offer_op,
|
61
|
+
attribute :create_account_op, CreateAccountOp
|
62
|
+
attribute :payment_op, PaymentOp
|
63
|
+
attribute :path_payment_strict_receive_op, PathPaymentStrictReceiveOp
|
64
|
+
attribute :manage_sell_offer_op, ManageSellOfferOp
|
65
|
+
attribute :create_passive_sell_offer_op, CreatePassiveSellOfferOp
|
66
|
+
attribute :set_options_op, SetOptionsOp
|
67
|
+
attribute :change_trust_op, ChangeTrustOp
|
68
|
+
attribute :allow_trust_op, AllowTrustOp
|
69
|
+
attribute :destination, MuxedAccount
|
70
|
+
attribute :manage_data_op, ManageDataOp
|
71
|
+
attribute :bump_sequence_op, BumpSequenceOp
|
72
|
+
attribute :manage_buy_offer_op, ManageBuyOfferOp
|
73
|
+
attribute :path_payment_strict_send_op, PathPaymentStrictSendOp
|
70
74
|
end
|
71
75
|
end
|
72
76
|
end
|
@@ -14,8 +14,8 @@ require 'xdr'
|
|
14
14
|
# CreateAccountResult createAccountResult;
|
15
15
|
# case PAYMENT:
|
16
16
|
# PaymentResult paymentResult;
|
17
|
-
# case
|
18
|
-
#
|
17
|
+
# case PATH_PAYMENT_STRICT_RECEIVE:
|
18
|
+
# PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
|
19
19
|
# case MANAGE_SELL_OFFER:
|
20
20
|
# ManageSellOfferResult manageSellOfferResult;
|
21
21
|
# case CREATE_PASSIVE_SELL_OFFER:
|
@@ -35,7 +35,9 @@ require 'xdr'
|
|
35
35
|
# case BUMP_SEQUENCE:
|
36
36
|
# BumpSequenceResult bumpSeqResult;
|
37
37
|
# case MANAGE_BUY_OFFER:
|
38
|
-
#
|
38
|
+
# ManageBuyOfferResult manageBuyOfferResult;
|
39
|
+
# case PATH_PAYMENT_STRICT_SEND:
|
40
|
+
# PathPaymentStrictSendResult pathPaymentStrictSendResult;
|
39
41
|
# }
|
40
42
|
# tr;
|
41
43
|
# default:
|
@@ -11,8 +11,8 @@ require 'xdr'
|
|
11
11
|
# CreateAccountResult createAccountResult;
|
12
12
|
# case PAYMENT:
|
13
13
|
# PaymentResult paymentResult;
|
14
|
-
# case
|
15
|
-
#
|
14
|
+
# case PATH_PAYMENT_STRICT_RECEIVE:
|
15
|
+
# PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
|
16
16
|
# case MANAGE_SELL_OFFER:
|
17
17
|
# ManageSellOfferResult manageSellOfferResult;
|
18
18
|
# case CREATE_PASSIVE_SELL_OFFER:
|
@@ -32,7 +32,9 @@ require 'xdr'
|
|
32
32
|
# case BUMP_SEQUENCE:
|
33
33
|
# BumpSequenceResult bumpSeqResult;
|
34
34
|
# case MANAGE_BUY_OFFER:
|
35
|
-
#
|
35
|
+
# ManageBuyOfferResult manageBuyOfferResult;
|
36
|
+
# case PATH_PAYMENT_STRICT_SEND:
|
37
|
+
# PathPaymentStrictSendResult pathPaymentStrictSendResult;
|
36
38
|
# }
|
37
39
|
#
|
38
40
|
# ===========================================================================
|
@@ -41,33 +43,35 @@ module Stellar
|
|
41
43
|
class Tr < XDR::Union
|
42
44
|
switch_on OperationType, :type
|
43
45
|
|
44
|
-
switch :create_account,
|
45
|
-
switch :payment,
|
46
|
-
switch :
|
47
|
-
switch :manage_sell_offer,
|
48
|
-
switch :create_passive_sell_offer,
|
49
|
-
switch :set_options,
|
50
|
-
switch :change_trust,
|
51
|
-
switch :allow_trust,
|
52
|
-
switch :account_merge,
|
53
|
-
switch :inflation,
|
54
|
-
switch :manage_data,
|
55
|
-
switch :bump_sequence,
|
56
|
-
switch :manage_buy_offer,
|
46
|
+
switch :create_account, :create_account_result
|
47
|
+
switch :payment, :payment_result
|
48
|
+
switch :path_payment_strict_receive, :path_payment_strict_receive_result
|
49
|
+
switch :manage_sell_offer, :manage_sell_offer_result
|
50
|
+
switch :create_passive_sell_offer, :create_passive_sell_offer_result
|
51
|
+
switch :set_options, :set_options_result
|
52
|
+
switch :change_trust, :change_trust_result
|
53
|
+
switch :allow_trust, :allow_trust_result
|
54
|
+
switch :account_merge, :account_merge_result
|
55
|
+
switch :inflation, :inflation_result
|
56
|
+
switch :manage_data, :manage_data_result
|
57
|
+
switch :bump_sequence, :bump_seq_result
|
58
|
+
switch :manage_buy_offer, :manage_buy_offer_result
|
59
|
+
switch :path_payment_strict_send, :path_payment_strict_send_result
|
57
60
|
|
58
|
-
attribute :create_account_result,
|
59
|
-
attribute :payment_result,
|
60
|
-
attribute :
|
61
|
-
attribute :manage_sell_offer_result,
|
62
|
-
attribute :create_passive_sell_offer_result,
|
63
|
-
attribute :set_options_result,
|
64
|
-
attribute :change_trust_result,
|
65
|
-
attribute :allow_trust_result,
|
66
|
-
attribute :account_merge_result,
|
67
|
-
attribute :inflation_result,
|
68
|
-
attribute :manage_data_result,
|
69
|
-
attribute :bump_seq_result,
|
70
|
-
attribute :manage_buy_offer_result,
|
61
|
+
attribute :create_account_result, CreateAccountResult
|
62
|
+
attribute :payment_result, PaymentResult
|
63
|
+
attribute :path_payment_strict_receive_result, PathPaymentStrictReceiveResult
|
64
|
+
attribute :manage_sell_offer_result, ManageSellOfferResult
|
65
|
+
attribute :create_passive_sell_offer_result, ManageSellOfferResult
|
66
|
+
attribute :set_options_result, SetOptionsResult
|
67
|
+
attribute :change_trust_result, ChangeTrustResult
|
68
|
+
attribute :allow_trust_result, AllowTrustResult
|
69
|
+
attribute :account_merge_result, AccountMergeResult
|
70
|
+
attribute :inflation_result, InflationResult
|
71
|
+
attribute :manage_data_result, ManageDataResult
|
72
|
+
attribute :bump_seq_result, BumpSequenceResult
|
73
|
+
attribute :manage_buy_offer_result, ManageBuyOfferResult
|
74
|
+
attribute :path_payment_strict_send_result, PathPaymentStrictSendResult
|
71
75
|
end
|
72
76
|
end
|
73
77
|
end
|
@@ -9,9 +9,9 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# opINNER = 0, // inner object result is valid
|
11
11
|
#
|
12
|
-
# opBAD_AUTH = -1,
|
13
|
-
# opNO_ACCOUNT = -2,
|
14
|
-
# opNOT_SUPPORTED = -3,
|
12
|
+
# opBAD_AUTH = -1, // too few valid signatures / wrong network
|
13
|
+
# opNO_ACCOUNT = -2, // source account was not found
|
14
|
+
# opNOT_SUPPORTED = -3, // operation not supported at this time
|
15
15
|
# opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached
|
16
16
|
# opEXCEEDED_WORK_LIMIT = -5 // operation did too much work
|
17
17
|
# };
|
@@ -9,7 +9,7 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# CREATE_ACCOUNT = 0,
|
11
11
|
# PAYMENT = 1,
|
12
|
-
#
|
12
|
+
# PATH_PAYMENT_STRICT_RECEIVE = 2,
|
13
13
|
# MANAGE_SELL_OFFER = 3,
|
14
14
|
# CREATE_PASSIVE_SELL_OFFER = 4,
|
15
15
|
# SET_OPTIONS = 5,
|
@@ -19,25 +19,27 @@ require 'xdr'
|
|
19
19
|
# INFLATION = 9,
|
20
20
|
# MANAGE_DATA = 10,
|
21
21
|
# BUMP_SEQUENCE = 11,
|
22
|
-
# MANAGE_BUY_OFFER = 12
|
22
|
+
# MANAGE_BUY_OFFER = 12,
|
23
|
+
# PATH_PAYMENT_STRICT_SEND = 13
|
23
24
|
# };
|
24
25
|
#
|
25
26
|
# ===========================================================================
|
26
27
|
module Stellar
|
27
28
|
class OperationType < XDR::Enum
|
28
|
-
member :create_account,
|
29
|
-
member :payment,
|
30
|
-
member :
|
31
|
-
member :manage_sell_offer,
|
32
|
-
member :create_passive_sell_offer,
|
33
|
-
member :set_options,
|
34
|
-
member :change_trust,
|
35
|
-
member :allow_trust,
|
36
|
-
member :account_merge,
|
37
|
-
member :inflation,
|
38
|
-
member :manage_data,
|
39
|
-
member :bump_sequence,
|
40
|
-
member :manage_buy_offer,
|
29
|
+
member :create_account, 0
|
30
|
+
member :payment, 1
|
31
|
+
member :path_payment_strict_receive, 2
|
32
|
+
member :manage_sell_offer, 3
|
33
|
+
member :create_passive_sell_offer, 4
|
34
|
+
member :set_options, 5
|
35
|
+
member :change_trust, 6
|
36
|
+
member :allow_trust, 7
|
37
|
+
member :account_merge, 8
|
38
|
+
member :inflation, 9
|
39
|
+
member :manage_data, 10
|
40
|
+
member :bump_sequence, 11
|
41
|
+
member :manage_buy_offer, 12
|
42
|
+
member :path_payment_strict_send, 13
|
41
43
|
|
42
44
|
seal
|
43
45
|
end
|
@@ -5,26 +5,26 @@ require 'xdr'
|
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
# struct
|
8
|
+
# struct PathPaymentStrictReceiveOp
|
9
9
|
# {
|
10
10
|
# Asset sendAsset; // asset we pay with
|
11
11
|
# int64 sendMax; // the maximum amount of sendAsset to
|
12
12
|
# // send (excluding fees).
|
13
13
|
# // The operation will fail if can't be met
|
14
14
|
#
|
15
|
-
#
|
16
|
-
# Asset destAsset;
|
17
|
-
# int64 destAmount;
|
15
|
+
# MuxedAccount destination; // recipient of the payment
|
16
|
+
# Asset destAsset; // what they end up with
|
17
|
+
# int64 destAmount; // amount they end up with
|
18
18
|
#
|
19
19
|
# Asset path<5>; // additional hops it must go through to get there
|
20
20
|
# };
|
21
21
|
#
|
22
22
|
# ===========================================================================
|
23
23
|
module Stellar
|
24
|
-
class
|
24
|
+
class PathPaymentStrictReceiveOp < XDR::Struct
|
25
25
|
attribute :send_asset, Asset
|
26
26
|
attribute :send_max, Int64
|
27
|
-
attribute :destination,
|
27
|
+
attribute :destination, MuxedAccount
|
28
28
|
attribute :dest_asset, Asset
|
29
29
|
attribute :dest_amount, Int64
|
30
30
|
attribute :path, XDR::VarArray[Asset, 5]
|
@@ -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 PathPaymentStrictReceiveResult switch (PathPaymentStrictReceiveResultCode code)
|
9
|
+
# {
|
10
|
+
# case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS:
|
11
|
+
# struct
|
12
|
+
# {
|
13
|
+
# ClaimOfferAtom offers<>;
|
14
|
+
# SimplePaymentResult last;
|
15
|
+
# } success;
|
16
|
+
# case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
|
17
|
+
# Asset noIssuer; // the asset that caused the error
|
18
|
+
# default:
|
19
|
+
# void;
|
20
|
+
# };
|
21
|
+
#
|
22
|
+
# ===========================================================================
|
23
|
+
module Stellar
|
24
|
+
class PathPaymentStrictReceiveResult < XDR::Union
|
25
|
+
include XDR::Namespace
|
26
|
+
|
27
|
+
autoload :Success
|
28
|
+
|
29
|
+
switch_on PathPaymentStrictReceiveResultCode, :code
|
30
|
+
|
31
|
+
switch :path_payment_strict_receive_success, :success
|
32
|
+
switch :path_payment_strict_receive_no_issuer, :no_issuer
|
33
|
+
switch :default
|
34
|
+
|
35
|
+
attribute :success, Success
|
36
|
+
attribute :no_issuer, Asset
|
37
|
+
end
|
38
|
+
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
|
9
|
+
# {
|
10
|
+
# ClaimOfferAtom offers<>;
|
11
|
+
# SimplePaymentResult last;
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class PathPaymentStrictReceiveResult
|
17
|
+
class Success < XDR::Struct
|
18
|
+
attribute :offers, XDR::VarArray[ClaimOfferAtom]
|
19
|
+
attribute :last, SimplePaymentResult
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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 PathPaymentStrictReceiveResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success
|
12
|
+
#
|
13
|
+
# // codes considered as "failure" for the operation
|
14
|
+
# PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input
|
15
|
+
# PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED =
|
16
|
+
# -2, // not enough funds in source account
|
17
|
+
# PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST =
|
18
|
+
# -3, // no trust line on source account
|
19
|
+
# PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED =
|
20
|
+
# -4, // source not authorized to transfer
|
21
|
+
# PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION =
|
22
|
+
# -5, // destination account does not exist
|
23
|
+
# PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST =
|
24
|
+
# -6, // dest missing a trust line for asset
|
25
|
+
# PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED =
|
26
|
+
# -7, // dest not authorized to hold asset
|
27
|
+
# PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL =
|
28
|
+
# -8, // dest would go above their limit
|
29
|
+
# PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset
|
30
|
+
# PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS =
|
31
|
+
# -10, // not enough offers to satisfy path
|
32
|
+
# PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF =
|
33
|
+
# -11, // would cross one of its own offers
|
34
|
+
# PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax
|
35
|
+
# };
|
36
|
+
#
|
37
|
+
# ===========================================================================
|
38
|
+
module Stellar
|
39
|
+
class PathPaymentStrictReceiveResultCode < XDR::Enum
|
40
|
+
member :path_payment_strict_receive_success, 0
|
41
|
+
member :path_payment_strict_receive_malformed, -1
|
42
|
+
member :path_payment_strict_receive_underfunded, -2
|
43
|
+
member :path_payment_strict_receive_src_no_trust, -3
|
44
|
+
member :path_payment_strict_receive_src_not_authorized, -4
|
45
|
+
member :path_payment_strict_receive_no_destination, -5
|
46
|
+
member :path_payment_strict_receive_no_trust, -6
|
47
|
+
member :path_payment_strict_receive_not_authorized, -7
|
48
|
+
member :path_payment_strict_receive_line_full, -8
|
49
|
+
member :path_payment_strict_receive_no_issuer, -9
|
50
|
+
member :path_payment_strict_receive_too_few_offers, -10
|
51
|
+
member :path_payment_strict_receive_offer_cross_self, -11
|
52
|
+
member :path_payment_strict_receive_over_sendmax, -12
|
53
|
+
|
54
|
+
seal
|
55
|
+
end
|
56
|
+
end
|