stellar-base 0.29.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/generated/stellar/account_entry_extension_v2/ext.rb +4 -0
- data/generated/stellar/account_entry_extension_v2.rb +2 -0
- data/generated/stellar/account_entry_extension_v3.rb +28 -0
- data/generated/stellar/allow_trust_result_code.rb +5 -2
- data/generated/stellar/alpha_num12.rb +20 -0
- data/generated/stellar/alpha_num4.rb +20 -0
- data/generated/stellar/asset.rb +2 -15
- data/generated/stellar/asset_type.rb +3 -1
- data/generated/stellar/change_trust_asset.rb +39 -0
- data/generated/stellar/change_trust_op.rb +2 -2
- data/generated/stellar/change_trust_result_code.rb +15 -7
- data/generated/stellar/claim_atom.rb +31 -0
- data/generated/stellar/claim_atom_type.rb +24 -0
- data/generated/stellar/claim_liquidity_atom.rb +30 -0
- data/generated/stellar/claim_offer_atom_v0.rb +33 -0
- data/generated/stellar/crypto_key_type.rb +6 -4
- data/generated/stellar/envelope_type.rb +10 -8
- data/generated/stellar/extension_point.rb +22 -0
- data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +2 -2
- data/generated/stellar/{operation_id.rb → hash_id_preimage/revoke_id.rb} +12 -16
- data/generated/stellar/hash_id_preimage.rb +44 -0
- data/generated/stellar/inner_transaction_result/result.rb +6 -2
- data/generated/stellar/inner_transaction_result.rb +2 -0
- data/generated/stellar/ledger_bounds.rb +20 -0
- data/generated/stellar/ledger_entry/data.rb +4 -0
- data/generated/stellar/ledger_entry.rb +2 -0
- data/generated/stellar/ledger_entry_type.rb +3 -1
- data/generated/stellar/ledger_header/ext.rb +4 -0
- data/generated/stellar/ledger_header.rb +2 -0
- data/generated/stellar/{asset/alpha_num12.rb → ledger_header_extension_v1/ext.rb} +9 -7
- data/generated/stellar/ledger_header_extension_v1.rb +30 -0
- data/generated/stellar/ledger_header_flags.rb +24 -0
- data/generated/stellar/{asset/alpha_num4.rb → ledger_key/liquidity_pool.rb} +4 -6
- data/generated/stellar/ledger_key/trust_line.rb +2 -2
- data/generated/stellar/ledger_key.rb +10 -1
- data/generated/stellar/ledger_upgrade.rb +4 -0
- data/generated/stellar/ledger_upgrade_type.rb +3 -1
- data/generated/stellar/liquidity_pool_constant_product_parameters.rb +22 -0
- data/generated/stellar/liquidity_pool_deposit_op.rb +26 -0
- data/generated/stellar/liquidity_pool_deposit_result.rb +25 -0
- data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
- data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +32 -0
- data/generated/stellar/liquidity_pool_entry/body.rb +38 -0
- data/generated/stellar/liquidity_pool_entry.rb +39 -0
- data/generated/stellar/liquidity_pool_parameters.rb +23 -0
- data/generated/stellar/liquidity_pool_type.rb +20 -0
- data/generated/stellar/liquidity_pool_withdraw_op.rb +24 -0
- data/generated/stellar/liquidity_pool_withdraw_result.rb +25 -0
- data/generated/stellar/liquidity_pool_withdraw_result_code.rb +36 -0
- data/generated/stellar/manage_offer_success_result.rb +2 -2
- data/generated/stellar/message_type.rb +4 -1
- data/generated/stellar/offer_entry_flags.rb +2 -1
- data/generated/stellar/operation/body.rb +8 -0
- data/generated/stellar/operation.rb +4 -0
- data/generated/stellar/operation_result/tr.rb +8 -0
- data/generated/stellar/operation_result.rb +4 -0
- data/generated/stellar/operation_type.rb +5 -1
- data/generated/stellar/path_payment_strict_receive_result/success.rb +2 -2
- data/generated/stellar/path_payment_strict_receive_result.rb +1 -1
- data/generated/stellar/path_payment_strict_send_result/success.rb +2 -2
- data/generated/stellar/path_payment_strict_send_result.rb +1 -1
- data/generated/stellar/precondition_type.rb +24 -0
- data/generated/stellar/preconditions.rb +30 -0
- data/generated/stellar/preconditions_v2.rb +51 -0
- data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
- data/generated/stellar/scp_quorum_set.rb +2 -2
- data/generated/stellar/send_more.rb +18 -0
- data/generated/stellar/set_trust_line_flags_result_code.rb +4 -1
- data/generated/stellar/signer_key/ed25519_signed_payload.rb +24 -0
- data/generated/stellar/signer_key.rb +20 -6
- data/generated/stellar/signer_key_type.rb +6 -4
- data/generated/stellar/stellar_message.rb +4 -0
- data/generated/stellar/transaction.rb +3 -3
- data/generated/stellar/transaction_result_code.rb +6 -1
- data/generated/stellar/trust_line_asset.rb +39 -0
- data/generated/stellar/trust_line_entry/ext/v1/ext.rb +4 -0
- data/generated/stellar/trust_line_entry/ext/v1.rb +2 -0
- data/generated/stellar/trust_line_entry/ext.rb +2 -0
- data/generated/stellar/trust_line_entry.rb +7 -5
- data/generated/stellar/trust_line_entry_extension_v2/ext.rb +24 -0
- data/generated/stellar/trust_line_entry_extension_v2.rb +30 -0
- data/generated/stellar-base-generated.rb +33 -1
- data/lib/stellar/account_flags.rb +1 -1
- data/lib/stellar/amount.rb +36 -0
- data/lib/stellar/asset.rb +8 -0
- data/lib/stellar/dsl.rb +3 -0
- data/lib/stellar/ledger_key.rb +5 -3
- data/lib/stellar/liquidity_pool/base_pool.rb +47 -0
- data/lib/stellar/liquidity_pool/constant_product_pool.rb +15 -0
- data/lib/stellar/liquidity_pool.rb +12 -0
- data/lib/stellar/operation.rb +346 -444
- data/lib/stellar/price.rb +13 -7
- data/lib/stellar/transaction.rb +1 -1
- data/lib/stellar/transaction_builder.rb +120 -18
- data/lib/stellar/transaction_v0.rb +5 -1
- data/lib/stellar/util/strkey.rb +15 -1
- data/lib/stellar/version.rb +1 -1
- data/lib/stellar-base.rb +2 -0
- metadata +51 -70
@@ -8,7 +8,7 @@ require 'xdr'
|
|
8
8
|
# struct ManageOfferSuccessResult
|
9
9
|
# {
|
10
10
|
# // offers that got claimed while creating this offer
|
11
|
-
#
|
11
|
+
# ClaimAtom offersClaimed<>;
|
12
12
|
#
|
13
13
|
# union switch (ManageOfferEffect effect)
|
14
14
|
# {
|
@@ -28,7 +28,7 @@ module Stellar
|
|
28
28
|
|
29
29
|
autoload :Offer
|
30
30
|
|
31
|
-
attribute :offers_claimed, XDR::VarArray[
|
31
|
+
attribute :offers_claimed, XDR::VarArray[ClaimAtom]
|
32
32
|
attribute :offer, Offer
|
33
33
|
end
|
34
34
|
end
|
@@ -29,7 +29,9 @@ require 'xdr'
|
|
29
29
|
# HELLO = 13,
|
30
30
|
#
|
31
31
|
# SURVEY_REQUEST = 14,
|
32
|
-
# SURVEY_RESPONSE = 15
|
32
|
+
# SURVEY_RESPONSE = 15,
|
33
|
+
#
|
34
|
+
# SEND_MORE = 16
|
33
35
|
# };
|
34
36
|
#
|
35
37
|
# ===========================================================================
|
@@ -50,6 +52,7 @@ module Stellar
|
|
50
52
|
member :hello, 13
|
51
53
|
member :survey_request, 14
|
52
54
|
member :survey_response, 15
|
55
|
+
member :send_more, 16
|
53
56
|
|
54
57
|
seal
|
55
58
|
end
|
@@ -51,6 +51,10 @@ require 'xdr'
|
|
51
51
|
# ClawbackClaimableBalanceOp clawbackClaimableBalanceOp;
|
52
52
|
# case SET_TRUST_LINE_FLAGS:
|
53
53
|
# SetTrustLineFlagsOp setTrustLineFlagsOp;
|
54
|
+
# case LIQUIDITY_POOL_DEPOSIT:
|
55
|
+
# LiquidityPoolDepositOp liquidityPoolDepositOp;
|
56
|
+
# case LIQUIDITY_POOL_WITHDRAW:
|
57
|
+
# LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
|
54
58
|
# }
|
55
59
|
#
|
56
60
|
# ===========================================================================
|
@@ -81,6 +85,8 @@ module Stellar
|
|
81
85
|
switch :clawback, :clawback_op
|
82
86
|
switch :clawback_claimable_balance, :clawback_claimable_balance_op
|
83
87
|
switch :set_trust_line_flags, :set_trust_line_flags_op
|
88
|
+
switch :liquidity_pool_deposit, :liquidity_pool_deposit_op
|
89
|
+
switch :liquidity_pool_withdraw, :liquidity_pool_withdraw_op
|
84
90
|
|
85
91
|
attribute :create_account_op, CreateAccountOp
|
86
92
|
attribute :payment_op, PaymentOp
|
@@ -102,6 +108,8 @@ module Stellar
|
|
102
108
|
attribute :clawback_op, ClawbackOp
|
103
109
|
attribute :clawback_claimable_balance_op, ClawbackClaimableBalanceOp
|
104
110
|
attribute :set_trust_line_flags_op, SetTrustLineFlagsOp
|
111
|
+
attribute :liquidity_pool_deposit_op, LiquidityPoolDepositOp
|
112
|
+
attribute :liquidity_pool_withdraw_op, LiquidityPoolWithdrawOp
|
105
113
|
end
|
106
114
|
end
|
107
115
|
end
|
@@ -58,6 +58,10 @@ require 'xdr'
|
|
58
58
|
# ClawbackClaimableBalanceOp clawbackClaimableBalanceOp;
|
59
59
|
# case SET_TRUST_LINE_FLAGS:
|
60
60
|
# SetTrustLineFlagsOp setTrustLineFlagsOp;
|
61
|
+
# case LIQUIDITY_POOL_DEPOSIT:
|
62
|
+
# LiquidityPoolDepositOp liquidityPoolDepositOp;
|
63
|
+
# case LIQUIDITY_POOL_WITHDRAW:
|
64
|
+
# LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
|
61
65
|
# }
|
62
66
|
# body;
|
63
67
|
# };
|
@@ -51,6 +51,10 @@ require 'xdr'
|
|
51
51
|
# ClawbackClaimableBalanceResult clawbackClaimableBalanceResult;
|
52
52
|
# case SET_TRUST_LINE_FLAGS:
|
53
53
|
# SetTrustLineFlagsResult setTrustLineFlagsResult;
|
54
|
+
# case LIQUIDITY_POOL_DEPOSIT:
|
55
|
+
# LiquidityPoolDepositResult liquidityPoolDepositResult;
|
56
|
+
# case LIQUIDITY_POOL_WITHDRAW:
|
57
|
+
# LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
|
54
58
|
# }
|
55
59
|
#
|
56
60
|
# ===========================================================================
|
@@ -81,6 +85,8 @@ module Stellar
|
|
81
85
|
switch :clawback, :clawback_result
|
82
86
|
switch :clawback_claimable_balance, :clawback_claimable_balance_result
|
83
87
|
switch :set_trust_line_flags, :set_trust_line_flags_result
|
88
|
+
switch :liquidity_pool_deposit, :liquidity_pool_deposit_result
|
89
|
+
switch :liquidity_pool_withdraw, :liquidity_pool_withdraw_result
|
84
90
|
|
85
91
|
attribute :create_account_result, CreateAccountResult
|
86
92
|
attribute :payment_result, PaymentResult
|
@@ -104,6 +110,8 @@ module Stellar
|
|
104
110
|
attribute :clawback_result, ClawbackResult
|
105
111
|
attribute :clawback_claimable_balance_result, ClawbackClaimableBalanceResult
|
106
112
|
attribute :set_trust_line_flags_result, SetTrustLineFlagsResult
|
113
|
+
attribute :liquidity_pool_deposit_result, LiquidityPoolDepositResult
|
114
|
+
attribute :liquidity_pool_withdraw_result, LiquidityPoolWithdrawResult
|
107
115
|
end
|
108
116
|
end
|
109
117
|
end
|
@@ -54,6 +54,10 @@ require 'xdr'
|
|
54
54
|
# ClawbackClaimableBalanceResult clawbackClaimableBalanceResult;
|
55
55
|
# case SET_TRUST_LINE_FLAGS:
|
56
56
|
# SetTrustLineFlagsResult setTrustLineFlagsResult;
|
57
|
+
# case LIQUIDITY_POOL_DEPOSIT:
|
58
|
+
# LiquidityPoolDepositResult liquidityPoolDepositResult;
|
59
|
+
# case LIQUIDITY_POOL_WITHDRAW:
|
60
|
+
# LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
|
57
61
|
# }
|
58
62
|
# tr;
|
59
63
|
# default:
|
@@ -28,7 +28,9 @@ require 'xdr'
|
|
28
28
|
# REVOKE_SPONSORSHIP = 18,
|
29
29
|
# CLAWBACK = 19,
|
30
30
|
# CLAWBACK_CLAIMABLE_BALANCE = 20,
|
31
|
-
# SET_TRUST_LINE_FLAGS = 21
|
31
|
+
# SET_TRUST_LINE_FLAGS = 21,
|
32
|
+
# LIQUIDITY_POOL_DEPOSIT = 22,
|
33
|
+
# LIQUIDITY_POOL_WITHDRAW = 23
|
32
34
|
# };
|
33
35
|
#
|
34
36
|
# ===========================================================================
|
@@ -56,6 +58,8 @@ module Stellar
|
|
56
58
|
member :clawback, 19
|
57
59
|
member :clawback_claimable_balance, 20
|
58
60
|
member :set_trust_line_flags, 21
|
61
|
+
member :liquidity_pool_deposit, 22
|
62
|
+
member :liquidity_pool_withdraw, 23
|
59
63
|
|
60
64
|
seal
|
61
65
|
end
|
@@ -7,7 +7,7 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# ClaimAtom offers<>;
|
11
11
|
# SimplePaymentResult last;
|
12
12
|
# }
|
13
13
|
#
|
@@ -15,7 +15,7 @@ require 'xdr'
|
|
15
15
|
module Stellar
|
16
16
|
class PathPaymentStrictReceiveResult
|
17
17
|
class Success < XDR::Struct
|
18
|
-
attribute :offers, XDR::VarArray[
|
18
|
+
attribute :offers, XDR::VarArray[ClaimAtom]
|
19
19
|
attribute :last, SimplePaymentResult
|
20
20
|
end
|
21
21
|
end
|
@@ -7,7 +7,7 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# ClaimAtom offers<>;
|
11
11
|
# SimplePaymentResult last;
|
12
12
|
# }
|
13
13
|
#
|
@@ -15,7 +15,7 @@ require 'xdr'
|
|
15
15
|
module Stellar
|
16
16
|
class PathPaymentStrictSendResult
|
17
17
|
class Success < XDR::Struct
|
18
|
-
attribute :offers, XDR::VarArray[
|
18
|
+
attribute :offers, XDR::VarArray[ClaimAtom]
|
19
19
|
attribute :last, SimplePaymentResult
|
20
20
|
end
|
21
21
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum PreconditionType
|
9
|
+
# {
|
10
|
+
# PRECOND_NONE = 0,
|
11
|
+
# PRECOND_TIME = 1,
|
12
|
+
# PRECOND_V2 = 2
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class PreconditionType < XDR::Enum
|
18
|
+
member :precond_none, 0
|
19
|
+
member :precond_time, 1
|
20
|
+
member :precond_v2, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union Preconditions switch (PreconditionType type)
|
9
|
+
# {
|
10
|
+
# case PRECOND_NONE:
|
11
|
+
# void;
|
12
|
+
# case PRECOND_TIME:
|
13
|
+
# TimeBounds timeBounds;
|
14
|
+
# case PRECOND_V2:
|
15
|
+
# PreconditionsV2 v2;
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class Preconditions < XDR::Union
|
21
|
+
switch_on PreconditionType, :type
|
22
|
+
|
23
|
+
switch :precond_none
|
24
|
+
switch :precond_time, :time_bounds
|
25
|
+
switch :precond_v2, :v2
|
26
|
+
|
27
|
+
attribute :time_bounds, TimeBounds
|
28
|
+
attribute :v2, PreconditionsV2
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct PreconditionsV2
|
9
|
+
# {
|
10
|
+
# TimeBounds* timeBounds;
|
11
|
+
#
|
12
|
+
# // Transaction only valid for ledger numbers n such that
|
13
|
+
# // minLedger <= n < maxLedger (if maxLedger == 0, then
|
14
|
+
# // only minLedger is checked)
|
15
|
+
# LedgerBounds* ledgerBounds;
|
16
|
+
#
|
17
|
+
# // If NULL, only valid when sourceAccount's sequence number
|
18
|
+
# // is seqNum - 1. Otherwise, valid when sourceAccount's
|
19
|
+
# // sequence number n satisfies minSeqNum <= n < tx.seqNum.
|
20
|
+
# // Note that after execution the account's sequence number
|
21
|
+
# // is always raised to tx.seqNum, and a transaction is not
|
22
|
+
# // valid if tx.seqNum is too high to ensure replay protection.
|
23
|
+
# SequenceNumber* minSeqNum;
|
24
|
+
#
|
25
|
+
# // For the transaction to be valid, the current ledger time must
|
26
|
+
# // be at least minSeqAge greater than sourceAccount's seqTime.
|
27
|
+
# Duration minSeqAge;
|
28
|
+
#
|
29
|
+
# // For the transaction to be valid, the current ledger number
|
30
|
+
# // must be at least minSeqLedgerGap greater than sourceAccount's
|
31
|
+
# // seqLedger.
|
32
|
+
# uint32 minSeqLedgerGap;
|
33
|
+
#
|
34
|
+
# // For the transaction to be valid, there must be a signature
|
35
|
+
# // corresponding to every Signer in this array, even if the
|
36
|
+
# // signature is not otherwise required by the sourceAccount or
|
37
|
+
# // operations.
|
38
|
+
# SignerKey extraSigners<2>;
|
39
|
+
# };
|
40
|
+
#
|
41
|
+
# ===========================================================================
|
42
|
+
module Stellar
|
43
|
+
class PreconditionsV2 < XDR::Struct
|
44
|
+
attribute :time_bounds, XDR::Option[TimeBounds]
|
45
|
+
attribute :ledger_bounds, XDR::Option[LedgerBounds]
|
46
|
+
attribute :min_seq_num, XDR::Option[SequenceNumber]
|
47
|
+
attribute :min_seq_age, Duration
|
48
|
+
attribute :min_seq_ledger_gap, Uint32
|
49
|
+
attribute :extra_signers, XDR::VarArray[SignerKey, 2]
|
50
|
+
end
|
51
|
+
end
|
@@ -14,7 +14,8 @@ require 'xdr'
|
|
14
14
|
# REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1,
|
15
15
|
# REVOKE_SPONSORSHIP_NOT_SPONSOR = -2,
|
16
16
|
# REVOKE_SPONSORSHIP_LOW_RESERVE = -3,
|
17
|
-
# REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4
|
17
|
+
# REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4,
|
18
|
+
# REVOKE_SPONSORSHIP_MALFORMED = -5
|
18
19
|
# };
|
19
20
|
#
|
20
21
|
# ===========================================================================
|
@@ -25,6 +26,7 @@ module Stellar
|
|
25
26
|
member :revoke_sponsorship_not_sponsor, -2
|
26
27
|
member :revoke_sponsorship_low_reserve, -3
|
27
28
|
member :revoke_sponsorship_only_transferable, -4
|
29
|
+
member :revoke_sponsorship_malformed, -5
|
28
30
|
|
29
31
|
seal
|
30
32
|
end
|
@@ -8,7 +8,7 @@ require 'xdr'
|
|
8
8
|
# struct SCPQuorumSet
|
9
9
|
# {
|
10
10
|
# uint32 threshold;
|
11
|
-
#
|
11
|
+
# NodeID validators<>;
|
12
12
|
# SCPQuorumSet innerSets<>;
|
13
13
|
# };
|
14
14
|
#
|
@@ -16,7 +16,7 @@ require 'xdr'
|
|
16
16
|
module Stellar
|
17
17
|
class SCPQuorumSet < XDR::Struct
|
18
18
|
attribute :threshold, Uint32
|
19
|
-
attribute :validators, XDR::VarArray[
|
19
|
+
attribute :validators, XDR::VarArray[NodeID]
|
20
20
|
attribute :inner_sets, XDR::VarArray[SCPQuorumSet]
|
21
21
|
end
|
22
22
|
end
|
@@ -0,0 +1,18 @@
|
|
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 SendMore
|
9
|
+
# {
|
10
|
+
# uint32 numMessages;
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class SendMore < XDR::Struct
|
16
|
+
attribute :num_messages, Uint32
|
17
|
+
end
|
18
|
+
end
|
@@ -14,7 +14,9 @@ require 'xdr'
|
|
14
14
|
# SET_TRUST_LINE_FLAGS_MALFORMED = -1,
|
15
15
|
# SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2,
|
16
16
|
# SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3,
|
17
|
-
# SET_TRUST_LINE_FLAGS_INVALID_STATE = -4
|
17
|
+
# SET_TRUST_LINE_FLAGS_INVALID_STATE = -4,
|
18
|
+
# SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created
|
19
|
+
# // on revoke due to low reserves
|
18
20
|
# };
|
19
21
|
#
|
20
22
|
# ===========================================================================
|
@@ -25,6 +27,7 @@ module Stellar
|
|
25
27
|
member :set_trust_line_flags_no_trust_line, -2
|
26
28
|
member :set_trust_line_flags_cant_revoke, -3
|
27
29
|
member :set_trust_line_flags_invalid_state, -4
|
30
|
+
member :set_trust_line_flags_low_reserve, -5
|
28
31
|
|
29
32
|
seal
|
30
33
|
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
|
+
# struct
|
9
|
+
# {
|
10
|
+
# /* Public key that must sign the payload. */
|
11
|
+
# uint256 ed25519;
|
12
|
+
# /* Payload to be raw signed by ed25519. */
|
13
|
+
# opaque payload<64>;
|
14
|
+
# }
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class SignerKey
|
19
|
+
class Ed25519SignedPayload < XDR::Struct
|
20
|
+
attribute :ed25519, Uint256
|
21
|
+
attribute :payload, XDR::VarOpaque[64]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -15,19 +15,33 @@ require 'xdr'
|
|
15
15
|
# case SIGNER_KEY_TYPE_HASH_X:
|
16
16
|
# /* Hash of random 256 bit preimage X */
|
17
17
|
# uint256 hashX;
|
18
|
+
# case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD:
|
19
|
+
# struct
|
20
|
+
# {
|
21
|
+
# /* Public key that must sign the payload. */
|
22
|
+
# uint256 ed25519;
|
23
|
+
# /* Payload to be raw signed by ed25519. */
|
24
|
+
# opaque payload<64>;
|
25
|
+
# } ed25519SignedPayload;
|
18
26
|
# };
|
19
27
|
#
|
20
28
|
# ===========================================================================
|
21
29
|
module Stellar
|
22
30
|
class SignerKey < XDR::Union
|
31
|
+
include XDR::Namespace
|
32
|
+
|
33
|
+
autoload :Ed25519SignedPayload
|
34
|
+
|
23
35
|
switch_on SignerKeyType, :type
|
24
36
|
|
25
|
-
switch :signer_key_type_ed25519,
|
26
|
-
switch :signer_key_type_pre_auth_tx,
|
27
|
-
switch :signer_key_type_hash_x,
|
37
|
+
switch :signer_key_type_ed25519, :ed25519
|
38
|
+
switch :signer_key_type_pre_auth_tx, :pre_auth_tx
|
39
|
+
switch :signer_key_type_hash_x, :hash_x
|
40
|
+
switch :signer_key_type_ed25519_signed_payload, :ed25519_signed_payload
|
28
41
|
|
29
|
-
attribute :ed25519,
|
30
|
-
attribute :pre_auth_tx,
|
31
|
-
attribute :hash_x,
|
42
|
+
attribute :ed25519, Uint256
|
43
|
+
attribute :pre_auth_tx, Uint256
|
44
|
+
attribute :hash_x, Uint256
|
45
|
+
attribute :ed25519_signed_payload, Ed25519SignedPayload
|
32
46
|
end
|
33
47
|
end
|
@@ -9,15 +9,17 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519,
|
11
11
|
# SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX,
|
12
|
-
# SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X
|
12
|
+
# SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X,
|
13
|
+
# SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD
|
13
14
|
# };
|
14
15
|
#
|
15
16
|
# ===========================================================================
|
16
17
|
module Stellar
|
17
18
|
class SignerKeyType < XDR::Enum
|
18
|
-
member :signer_key_type_ed25519,
|
19
|
-
member :signer_key_type_pre_auth_tx,
|
20
|
-
member :signer_key_type_hash_x,
|
19
|
+
member :signer_key_type_ed25519, 0
|
20
|
+
member :signer_key_type_pre_auth_tx, 1
|
21
|
+
member :signer_key_type_hash_x, 2
|
22
|
+
member :signer_key_type_ed25519_signed_payload, 3
|
21
23
|
|
22
24
|
seal
|
23
25
|
end
|
@@ -43,6 +43,8 @@ require 'xdr'
|
|
43
43
|
# SCPEnvelope envelope;
|
44
44
|
# case GET_SCP_STATE:
|
45
45
|
# uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
|
46
|
+
# case SEND_MORE:
|
47
|
+
# SendMore sendMoreMessage;
|
46
48
|
# };
|
47
49
|
#
|
48
50
|
# ===========================================================================
|
@@ -65,6 +67,7 @@ module Stellar
|
|
65
67
|
switch :scp_quorumset, :q_set
|
66
68
|
switch :scp_message, :envelope
|
67
69
|
switch :get_scp_state, :get_scp_ledger_seq
|
70
|
+
switch :send_more, :send_more_message
|
68
71
|
|
69
72
|
attribute :error, Error
|
70
73
|
attribute :hello, Hello
|
@@ -80,5 +83,6 @@ module Stellar
|
|
80
83
|
attribute :q_set, SCPQuorumSet
|
81
84
|
attribute :envelope, SCPEnvelope
|
82
85
|
attribute :get_scp_ledger_seq, Uint32
|
86
|
+
attribute :send_more_message, SendMore
|
83
87
|
end
|
84
88
|
end
|
@@ -16,8 +16,8 @@ require 'xdr'
|
|
16
16
|
# // sequence number to consume in the account
|
17
17
|
# SequenceNumber seqNum;
|
18
18
|
#
|
19
|
-
# // validity
|
20
|
-
#
|
19
|
+
# // validity conditions
|
20
|
+
# Preconditions cond;
|
21
21
|
#
|
22
22
|
# Memo memo;
|
23
23
|
#
|
@@ -42,7 +42,7 @@ module Stellar
|
|
42
42
|
attribute :source_account, MuxedAccount
|
43
43
|
attribute :fee, Uint32
|
44
44
|
attribute :seq_num, SequenceNumber
|
45
|
-
attribute :
|
45
|
+
attribute :cond, Preconditions
|
46
46
|
attribute :memo, Memo
|
47
47
|
attribute :operations, XDR::VarArray[Operation, MAX_OPS_PER_TX]
|
48
48
|
attribute :ext, Ext
|
@@ -26,7 +26,10 @@ require 'xdr'
|
|
26
26
|
#
|
27
27
|
# txNOT_SUPPORTED = -12, // transaction type not supported
|
28
28
|
# txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
|
29
|
-
# txBAD_SPONSORSHIP = -14
|
29
|
+
# txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
|
30
|
+
# txBAD_MIN_SEQ_AGE_OR_GAP =
|
31
|
+
# -15, // minSeqAge or minSeqLedgerGap conditions not met
|
32
|
+
# txMALFORMED = -16 // precondition is invalid
|
30
33
|
# };
|
31
34
|
#
|
32
35
|
# ===========================================================================
|
@@ -48,6 +51,8 @@ module Stellar
|
|
48
51
|
member :tx_not_supported, -12
|
49
52
|
member :tx_fee_bump_inner_failed, -13
|
50
53
|
member :tx_bad_sponsorship, -14
|
54
|
+
member :tx_bad_min_seq_age_or_gap, -15
|
55
|
+
member :tx_malformed, -16
|
51
56
|
|
52
57
|
seal
|
53
58
|
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
|
+
# union TrustLineAsset switch (AssetType type)
|
9
|
+
# {
|
10
|
+
# case ASSET_TYPE_NATIVE: // Not credit
|
11
|
+
# void;
|
12
|
+
#
|
13
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
14
|
+
# AlphaNum4 alphaNum4;
|
15
|
+
#
|
16
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
17
|
+
# AlphaNum12 alphaNum12;
|
18
|
+
#
|
19
|
+
# case ASSET_TYPE_POOL_SHARE:
|
20
|
+
# PoolID liquidityPoolID;
|
21
|
+
#
|
22
|
+
# // add other asset types here in the future
|
23
|
+
# };
|
24
|
+
#
|
25
|
+
# ===========================================================================
|
26
|
+
module Stellar
|
27
|
+
class TrustLineAsset < XDR::Union
|
28
|
+
switch_on AssetType, :type
|
29
|
+
|
30
|
+
switch :asset_type_native
|
31
|
+
switch :asset_type_credit_alphanum4, :alpha_num4
|
32
|
+
switch :asset_type_credit_alphanum12, :alpha_num12
|
33
|
+
switch :asset_type_pool_share, :liquidity_pool_id
|
34
|
+
|
35
|
+
attribute :alpha_num4, AlphaNum4
|
36
|
+
attribute :alpha_num12, AlphaNum12
|
37
|
+
attribute :liquidity_pool_id, PoolID
|
38
|
+
end
|
39
|
+
end
|
@@ -9,6 +9,8 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# case 0:
|
11
11
|
# void;
|
12
|
+
# case 2:
|
13
|
+
# TrustLineEntryExtensionV2 v2;
|
12
14
|
# }
|
13
15
|
#
|
14
16
|
# ===========================================================================
|
@@ -20,7 +22,9 @@ module Stellar
|
|
20
22
|
switch_on XDR::Int, :v
|
21
23
|
|
22
24
|
switch 0
|
25
|
+
switch 2, :v2
|
23
26
|
|
27
|
+
attribute :v2, TrustLineEntryExtensionV2
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -7,10 +7,10 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct TrustLineEntry
|
9
9
|
# {
|
10
|
-
# AccountID accountID;
|
11
|
-
#
|
12
|
-
# int64 balance;
|
13
|
-
#
|
10
|
+
# AccountID accountID; // account this trustline belongs to
|
11
|
+
# TrustLineAsset asset; // type of asset (with issuer)
|
12
|
+
# int64 balance; // how much of this asset the user has.
|
13
|
+
# // Asset defines the unit for this;
|
14
14
|
#
|
15
15
|
# int64 limit; // balance cannot be above this
|
16
16
|
# uint32 flags; // see TrustLineFlags
|
@@ -29,6 +29,8 @@ require 'xdr'
|
|
29
29
|
# {
|
30
30
|
# case 0:
|
31
31
|
# void;
|
32
|
+
# case 2:
|
33
|
+
# TrustLineEntryExtensionV2 v2;
|
32
34
|
# }
|
33
35
|
# ext;
|
34
36
|
# } v1;
|
@@ -44,7 +46,7 @@ module Stellar
|
|
44
46
|
autoload :Ext
|
45
47
|
|
46
48
|
attribute :account_id, AccountID
|
47
|
-
attribute :asset,
|
49
|
+
attribute :asset, TrustLineAsset
|
48
50
|
attribute :balance, Int64
|
49
51
|
attribute :limit, Int64
|
50
52
|
attribute :flags, Uint32
|