stellar-base 0.26.0 → 0.30.0
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 +4 -4
- data/CHANGELOG.md +54 -32
- data/README.md +3 -3
- data/generated/stellar/account_flags.rb +9 -4
- data/generated/stellar/account_merge_result.rb +1 -1
- data/generated/stellar/allow_trust_op.rb +3 -18
- data/generated/stellar/allow_trust_result_code.rb +4 -1
- 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_code.rb +30 -0
- data/generated/stellar/asset_type.rb +3 -1
- data/generated/stellar/begin_sponsoring_future_reserves_result.rb +2 -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 +13 -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/claimable_balance_entry/ext.rb +4 -0
- data/generated/stellar/claimable_balance_entry.rb +2 -0
- data/generated/stellar/{asset/alpha_num12.rb → claimable_balance_entry_extension_v1/ext.rb} +9 -7
- data/generated/stellar/{operation_id.rb → claimable_balance_entry_extension_v1.rb} +12 -14
- data/generated/stellar/claimable_balance_flags.rb +22 -0
- data/generated/stellar/clawback_claimable_balance_op.rb +18 -0
- data/generated/stellar/clawback_claimable_balance_result.rb +26 -0
- data/generated/stellar/clawback_claimable_balance_result_code.rb +29 -0
- data/generated/stellar/clawback_op.rb +22 -0
- data/generated/stellar/clawback_result.rb +25 -0
- data/generated/stellar/clawback_result_code.rb +31 -0
- data/generated/stellar/create_passive_sell_offer_op.rb +1 -1
- data/generated/stellar/end_sponsoring_future_reserves_result.rb +2 -1
- data/generated/stellar/envelope_type.rb +10 -8
- data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +4 -4
- data/generated/stellar/hash_id_preimage/revoke_id.rb +28 -0
- data/generated/stellar/hash_id_preimage.rb +44 -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/ledger_header_extension_v1/ext.rb +24 -0
- 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 +26 -0
- data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
- data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +31 -0
- data/generated/stellar/liquidity_pool_entry/body.rb +37 -0
- data/generated/stellar/liquidity_pool_entry.rb +38 -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 +26 -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/operation/body.rb +20 -0
- data/generated/stellar/operation.rb +10 -0
- data/generated/stellar/operation_result/tr.rb +20 -0
- data/generated/stellar/operation_result.rb +10 -0
- data/generated/stellar/operation_type.rb +11 -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/payment_result_code.rb +1 -1
- data/generated/stellar/revoke_sponsorship_op.rb +1 -2
- data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
- data/generated/stellar/scp_quorum_set.rb +2 -2
- data/generated/stellar/set_options_result_code.rb +14 -11
- data/generated/stellar/set_trust_line_flags_op.rb +25 -0
- data/generated/stellar/set_trust_line_flags_result.rb +25 -0
- data/generated/stellar/set_trust_line_flags_result_code.rb +34 -0
- data/generated/stellar/transaction_result_code.rb +1 -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/trust_line_flags.rb +5 -1
- data/generated/stellar-base-generated.rb +40 -1
- data/lib/stellar/account.rb +59 -0
- 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/compat.rb +6 -3
- data/lib/stellar/concerns/transaction.rb +4 -2
- data/lib/stellar/dsl.rb +26 -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 +357 -386
- data/lib/stellar/price.rb +13 -7
- data/lib/stellar/transaction_builder.rb +27 -11
- data/lib/stellar/trust_line_flags.rb +53 -0
- data/lib/stellar/util/strkey.rb +15 -7
- data/lib/stellar/version.rb +3 -0
- data/lib/stellar-base.rb +5 -2
- metadata +61 -16
- data/generated/stellar/allow_trust_op/asset.rb +0 -33
- data/lib/stellar/base/version.rb +0 -5
data/lib/stellar/price.rb
CHANGED
|
@@ -3,23 +3,29 @@ module Stellar
|
|
|
3
3
|
class Price
|
|
4
4
|
MAX_PRECISION = (2**31) - 1
|
|
5
5
|
|
|
6
|
-
def self.
|
|
7
|
-
|
|
6
|
+
def self.from(number)
|
|
7
|
+
number = BigDecimal(number, 0) if number.is_a?(String)
|
|
8
|
+
number = number.to_r if number.respond_to?(:to_r)
|
|
9
|
+
|
|
10
|
+
raise ArgumentError, "Couldn't convert #{number.class} to rational number" unless number.is_a?(Rational)
|
|
11
|
+
|
|
12
|
+
best_r = number.rationalize(1.0e-7)
|
|
8
13
|
|
|
9
14
|
if best_r.numerator > MAX_PRECISION || best_r.denominator > MAX_PRECISION
|
|
10
|
-
raise ArgumentError
|
|
15
|
+
raise ArgumentError, "Couldn't find valid price approximation for #{number}"
|
|
11
16
|
end
|
|
12
17
|
|
|
13
|
-
new(
|
|
14
|
-
n: best_r.numerator,
|
|
15
|
-
d: best_r.denominator
|
|
16
|
-
})
|
|
18
|
+
new(n: best_r.numerator, d: best_r.denominator)
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
def invert
|
|
20
22
|
self.class.new(n: d, d: n)
|
|
21
23
|
end
|
|
22
24
|
|
|
25
|
+
def to_r
|
|
26
|
+
Rational(n, d)
|
|
27
|
+
end
|
|
28
|
+
|
|
23
29
|
def to_d
|
|
24
30
|
n.to_d / d
|
|
25
31
|
end
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module Stellar
|
|
2
2
|
class TransactionBuilder
|
|
3
|
+
include Stellar::DSL
|
|
4
|
+
|
|
3
5
|
attr_reader :source_account, :sequence_number, :base_fee, :time_bounds, :memo, :operations
|
|
4
6
|
|
|
5
7
|
class << self
|
|
@@ -9,11 +11,14 @@ module Stellar
|
|
|
9
11
|
# It reduces the boilerplate, when you just need to
|
|
10
12
|
# shoot a single operation in transaction
|
|
11
13
|
def method_missing(method_name, *args, **kwargs)
|
|
12
|
-
unless
|
|
13
|
-
return super
|
|
14
|
-
end
|
|
14
|
+
return super unless Operation.respond_to?(method_name)
|
|
15
15
|
|
|
16
|
-
op =
|
|
16
|
+
op = Operation.send(
|
|
17
|
+
method_name,
|
|
18
|
+
**kwargs.except(
|
|
19
|
+
:source_account, :sequence_number, :base_fee, :time_bounds, :memo, :enable_muxed_accounts
|
|
20
|
+
)
|
|
21
|
+
)
|
|
17
22
|
|
|
18
23
|
new(**kwargs).add_operation(op).build
|
|
19
24
|
end
|
|
@@ -29,21 +34,20 @@ module Stellar
|
|
|
29
34
|
base_fee: 100,
|
|
30
35
|
time_bounds: nil,
|
|
31
36
|
memo: nil,
|
|
37
|
+
enable_muxed_accounts: false,
|
|
32
38
|
**_ # ignore any additional parameters without errors
|
|
33
39
|
)
|
|
34
|
-
raise ArgumentError, "Bad :source_account" unless source_account.is_a?(Stellar::KeyPair)
|
|
35
40
|
raise ArgumentError, "Bad :sequence_number" unless sequence_number.is_a?(Integer) && sequence_number >= 0
|
|
36
41
|
raise ArgumentError, "Bad :time_bounds" unless time_bounds.is_a?(Stellar::TimeBounds) || time_bounds.nil?
|
|
37
42
|
raise ArgumentError, "Bad :base_fee" unless base_fee.is_a?(Integer) && base_fee >= 100
|
|
38
43
|
|
|
39
|
-
@source_account = source_account
|
|
44
|
+
@source_account = Account(source_account)
|
|
40
45
|
@sequence_number = sequence_number
|
|
41
46
|
@base_fee = base_fee
|
|
42
47
|
@time_bounds = time_bounds
|
|
48
|
+
@enable_muxed_accounts = enable_muxed_accounts
|
|
43
49
|
|
|
44
|
-
if time_bounds.nil?
|
|
45
|
-
set_timeout(0)
|
|
46
|
-
end
|
|
50
|
+
set_timeout(0) if time_bounds.nil?
|
|
47
51
|
|
|
48
52
|
@memo = make_memo(memo)
|
|
49
53
|
@operations = []
|
|
@@ -59,7 +63,7 @@ module Stellar
|
|
|
59
63
|
end
|
|
60
64
|
|
|
61
65
|
attrs = {
|
|
62
|
-
source_account:
|
|
66
|
+
source_account: source_muxed_account,
|
|
63
67
|
fee: @base_fee * @operations.length,
|
|
64
68
|
seq_num: @sequence_number,
|
|
65
69
|
time_bounds: @time_bounds,
|
|
@@ -90,7 +94,7 @@ module Stellar
|
|
|
90
94
|
end
|
|
91
95
|
|
|
92
96
|
Stellar::FeeBumpTransaction.new(
|
|
93
|
-
fee_source:
|
|
97
|
+
fee_source: source_muxed_account,
|
|
94
98
|
fee: @base_fee * (inner_ops.length + 1),
|
|
95
99
|
inner_tx: Stellar::FeeBumpTransaction::InnerTx.new(:envelope_type_tx, inner_txe.v1!),
|
|
96
100
|
ext: Stellar::FeeBumpTransaction::Ext.new(0)
|
|
@@ -162,5 +166,17 @@ module Stellar
|
|
|
162
166
|
raise ArgumentError, "Bad :memo"
|
|
163
167
|
end
|
|
164
168
|
end
|
|
169
|
+
|
|
170
|
+
def source_muxed_account
|
|
171
|
+
if with_muxed_accounts?
|
|
172
|
+
@source_account.muxed_account
|
|
173
|
+
else
|
|
174
|
+
@source_account.base_account
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def with_muxed_accounts?
|
|
179
|
+
@enable_muxed_accounts
|
|
180
|
+
end
|
|
165
181
|
end
|
|
166
182
|
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module Stellar
|
|
2
|
+
class TrustLineFlags
|
|
3
|
+
# Converts an array of Stellar::TrustLineFlags members into
|
|
4
|
+
# an integers suitable for use in in a SetTrustLineFlagsOp.
|
|
5
|
+
#
|
|
6
|
+
# @param flags [Array<Stellar::TrustLineFlags>] the flags to combine
|
|
7
|
+
#
|
|
8
|
+
# @return [Fixnum] the combined result
|
|
9
|
+
def self.make_mask(flags)
|
|
10
|
+
normalize(flags).map(&:value).inject(&:|) || 0
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Converts an integer used in SetTrustLineFlagsOp on the set/clear flag options
|
|
14
|
+
# into an array of Stellar::TrustLineFlags members
|
|
15
|
+
#
|
|
16
|
+
# @param combined [Fixnum]
|
|
17
|
+
# @return [Array<Stellar::AccountFlags>]
|
|
18
|
+
def self.parse_mask(combined)
|
|
19
|
+
members.values.select { |m| (m.value & combined) != 0 }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Converts each element of the input array to Stellar::TrustLineFlags instance.
|
|
23
|
+
#
|
|
24
|
+
# @param [Array<Stellar::TrustLineFlags,Symbol,#to_s>] input
|
|
25
|
+
# @return [Array<Stellar::TrustLineFlags>]
|
|
26
|
+
# @raise [TypeError] if any element of the input cannot be converted
|
|
27
|
+
def self.normalize(input)
|
|
28
|
+
input.map do |val|
|
|
29
|
+
case val
|
|
30
|
+
when Stellar::TrustLineFlags
|
|
31
|
+
val
|
|
32
|
+
when ->(_) { members.key?(val.to_s) }
|
|
33
|
+
from_name(val.to_s)
|
|
34
|
+
when ->(_) { members.key?("#{val}_flag") }
|
|
35
|
+
from_name("#{val}_flag")
|
|
36
|
+
else
|
|
37
|
+
raise TypeError, "unknown trustline flag: #{val}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.set_clear_masks(flags)
|
|
43
|
+
set_flags = []
|
|
44
|
+
clear_flags = []
|
|
45
|
+
|
|
46
|
+
Hash(flags).each do |flag, value|
|
|
47
|
+
value.present? ? set_flags.push(flag) : clear_flags.push(flag)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
{set_flags: make_mask(set_flags), clear_flags: make_mask(clear_flags)}
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
data/lib/stellar/util/strkey.rb
CHANGED
|
@@ -8,7 +8,8 @@ module Stellar
|
|
|
8
8
|
account_id: [6 << 3].pack("C"), # Base32-encodes to 'G...'
|
|
9
9
|
seed: [18 << 3].pack("C"), # Base32-encodes to 'S...'
|
|
10
10
|
pre_auth_tx: [19 << 3].pack("C"), # Base32-encodes to 'T...'
|
|
11
|
-
hash_x: [23 << 3].pack("C") # Base32-encodes to 'X...'
|
|
11
|
+
hash_x: [23 << 3].pack("C"), # Base32-encodes to 'X...'
|
|
12
|
+
muxed: [12 << 3].pack("C") # Base32-encodes to 'M...'
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
def self.check_encode(version, byte_str)
|
|
@@ -25,13 +26,11 @@ module Stellar
|
|
|
25
26
|
# @param muxed_account [Stellar::MuxedAccount] account
|
|
26
27
|
# @return [String] "G.."-like address
|
|
27
28
|
def self.encode_muxed_account(muxed_account)
|
|
28
|
-
|
|
29
|
-
muxed_account.ed25519
|
|
29
|
+
if muxed_account.ed25519
|
|
30
|
+
check_encode(:account_id, muxed_account.ed25519)
|
|
30
31
|
else
|
|
31
|
-
muxed_account.med25519!.ed25519
|
|
32
|
+
check_encode(:muxed, muxed_account.med25519!.ed25519 + [muxed_account.med25519!.id].pack("Q>"))
|
|
32
33
|
end
|
|
33
|
-
|
|
34
|
-
check_encode(:account_id, ed25519)
|
|
35
34
|
end
|
|
36
35
|
|
|
37
36
|
# Returns a Stellar::MuxedAccount, forcing the ed25519 discriminant
|
|
@@ -39,7 +38,16 @@ module Stellar
|
|
|
39
38
|
# @param strkey [String] address string to decode
|
|
40
39
|
# @return [Stellar::MuxedAccount] MuxedAccount with ed25519 discriminant
|
|
41
40
|
def self.decode_muxed_account(strkey)
|
|
42
|
-
|
|
41
|
+
case strkey
|
|
42
|
+
when /^G[0-9A-Z]{55}$/
|
|
43
|
+
ed25519 = check_decode(:account_id, strkey)
|
|
44
|
+
Stellar::MuxedAccount.ed25519(ed25519)
|
|
45
|
+
when /^M[0-9A-Z]{68}$/
|
|
46
|
+
payload = check_decode(:muxed, strkey)
|
|
47
|
+
Stellar::MuxedAccount.med25519(ed25519: payload[0, 32], id: payload[32, 8].unpack1("Q>"))
|
|
48
|
+
else
|
|
49
|
+
raise "cannot decode MuxedAccount from #{strkey}"
|
|
50
|
+
end
|
|
43
51
|
end
|
|
44
52
|
|
|
45
53
|
def self.check_decode(expected_version, str)
|
data/lib/stellar-base.rb
CHANGED
|
@@ -16,25 +16,28 @@ silence_warnings do
|
|
|
16
16
|
end
|
|
17
17
|
Stellar.load_all!
|
|
18
18
|
|
|
19
|
-
require_relative "stellar/
|
|
20
|
-
Stellar::VERSION = Stellar::Base::VERSION
|
|
19
|
+
require_relative "stellar/version"
|
|
21
20
|
|
|
22
21
|
Stellar::ONE = 1_0000000
|
|
23
22
|
Stellar::Deprecation = ActiveSupport::Deprecation.new("next release", "stellar-base")
|
|
24
23
|
|
|
25
24
|
# extensions onto the generated files must be loaded manually, below
|
|
26
25
|
|
|
26
|
+
require_relative "./stellar/account"
|
|
27
27
|
require_relative "./stellar/account_flags"
|
|
28
|
+
require_relative "./stellar/amount"
|
|
28
29
|
require_relative "./stellar/asset"
|
|
29
30
|
require_relative "./stellar/claim_predicate"
|
|
30
31
|
require_relative "./stellar/key_pair"
|
|
31
32
|
require_relative "./stellar/ledger_key"
|
|
33
|
+
require_relative "./stellar/liquidity_pool"
|
|
32
34
|
require_relative "./stellar/networks"
|
|
33
35
|
require_relative "./stellar/operation"
|
|
34
36
|
require_relative "./stellar/path_payment_strict_receive_result"
|
|
35
37
|
require_relative "./stellar/price"
|
|
36
38
|
require_relative "./stellar/signer_key"
|
|
37
39
|
require_relative "./stellar/thresholds"
|
|
40
|
+
require_relative "./stellar/trust_line_flags"
|
|
38
41
|
|
|
39
42
|
require_relative "./stellar/concerns/transaction"
|
|
40
43
|
require_relative "./stellar/fee_bump_transaction"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stellar-base
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.30.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Fleckenstein
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2021-
|
|
13
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activesupport
|
|
@@ -168,9 +168,9 @@ dependencies:
|
|
|
168
168
|
- - "~>"
|
|
169
169
|
- !ruby/object:Gem::Version
|
|
170
170
|
version: '1.3'
|
|
171
|
-
description:
|
|
172
|
-
It consists of classes to read, write,
|
|
173
|
-
are used in stellar-core
|
|
171
|
+
description: |
|
|
172
|
+
The stellar-base library is the lowest-level stellar helper library. It consists of classes to read, write,
|
|
173
|
+
hash, and sign the xdr structures that are used in stellar-core.
|
|
174
174
|
email:
|
|
175
175
|
executables: []
|
|
176
176
|
extensions: []
|
|
@@ -193,12 +193,12 @@ files:
|
|
|
193
193
|
- generated/stellar/account_merge_result.rb
|
|
194
194
|
- generated/stellar/account_merge_result_code.rb
|
|
195
195
|
- generated/stellar/allow_trust_op.rb
|
|
196
|
-
- generated/stellar/allow_trust_op/asset.rb
|
|
197
196
|
- generated/stellar/allow_trust_result.rb
|
|
198
197
|
- generated/stellar/allow_trust_result_code.rb
|
|
198
|
+
- generated/stellar/alpha_num12.rb
|
|
199
|
+
- generated/stellar/alpha_num4.rb
|
|
199
200
|
- generated/stellar/asset.rb
|
|
200
|
-
- generated/stellar/
|
|
201
|
-
- generated/stellar/asset/alpha_num4.rb
|
|
201
|
+
- generated/stellar/asset_code.rb
|
|
202
202
|
- generated/stellar/asset_type.rb
|
|
203
203
|
- generated/stellar/auth.rb
|
|
204
204
|
- generated/stellar/auth_cert.rb
|
|
@@ -214,22 +214,36 @@ files:
|
|
|
214
214
|
- generated/stellar/bump_sequence_op.rb
|
|
215
215
|
- generated/stellar/bump_sequence_result.rb
|
|
216
216
|
- generated/stellar/bump_sequence_result_code.rb
|
|
217
|
+
- generated/stellar/change_trust_asset.rb
|
|
217
218
|
- generated/stellar/change_trust_op.rb
|
|
218
219
|
- generated/stellar/change_trust_result.rb
|
|
219
220
|
- generated/stellar/change_trust_result_code.rb
|
|
221
|
+
- generated/stellar/claim_atom.rb
|
|
222
|
+
- generated/stellar/claim_atom_type.rb
|
|
220
223
|
- generated/stellar/claim_claimable_balance_op.rb
|
|
221
224
|
- generated/stellar/claim_claimable_balance_result.rb
|
|
222
225
|
- generated/stellar/claim_claimable_balance_result_code.rb
|
|
226
|
+
- generated/stellar/claim_liquidity_atom.rb
|
|
223
227
|
- generated/stellar/claim_offer_atom.rb
|
|
228
|
+
- generated/stellar/claim_offer_atom_v0.rb
|
|
224
229
|
- generated/stellar/claim_predicate.rb
|
|
225
230
|
- generated/stellar/claim_predicate_type.rb
|
|
226
231
|
- generated/stellar/claimable_balance_entry.rb
|
|
227
232
|
- generated/stellar/claimable_balance_entry/ext.rb
|
|
233
|
+
- generated/stellar/claimable_balance_entry_extension_v1.rb
|
|
234
|
+
- generated/stellar/claimable_balance_entry_extension_v1/ext.rb
|
|
235
|
+
- generated/stellar/claimable_balance_flags.rb
|
|
228
236
|
- generated/stellar/claimable_balance_id.rb
|
|
229
237
|
- generated/stellar/claimable_balance_id_type.rb
|
|
230
238
|
- generated/stellar/claimant.rb
|
|
231
239
|
- generated/stellar/claimant/v0.rb
|
|
232
240
|
- generated/stellar/claimant_type.rb
|
|
241
|
+
- generated/stellar/clawback_claimable_balance_op.rb
|
|
242
|
+
- generated/stellar/clawback_claimable_balance_result.rb
|
|
243
|
+
- generated/stellar/clawback_claimable_balance_result_code.rb
|
|
244
|
+
- generated/stellar/clawback_op.rb
|
|
245
|
+
- generated/stellar/clawback_result.rb
|
|
246
|
+
- generated/stellar/clawback_result_code.rb
|
|
233
247
|
- generated/stellar/create_account_op.rb
|
|
234
248
|
- generated/stellar/create_account_result.rb
|
|
235
249
|
- generated/stellar/create_account_result_code.rb
|
|
@@ -253,6 +267,9 @@ files:
|
|
|
253
267
|
- generated/stellar/fee_bump_transaction/ext.rb
|
|
254
268
|
- generated/stellar/fee_bump_transaction/inner_tx.rb
|
|
255
269
|
- generated/stellar/fee_bump_transaction_envelope.rb
|
|
270
|
+
- generated/stellar/hash_id_preimage.rb
|
|
271
|
+
- generated/stellar/hash_id_preimage/operation_id.rb
|
|
272
|
+
- generated/stellar/hash_id_preimage/revoke_id.rb
|
|
256
273
|
- generated/stellar/hello.rb
|
|
257
274
|
- generated/stellar/hmac_sha256_key.rb
|
|
258
275
|
- generated/stellar/hmac_sha256_mac.rb
|
|
@@ -277,18 +294,34 @@ files:
|
|
|
277
294
|
- generated/stellar/ledger_entry_type.rb
|
|
278
295
|
- generated/stellar/ledger_header.rb
|
|
279
296
|
- generated/stellar/ledger_header/ext.rb
|
|
297
|
+
- generated/stellar/ledger_header_extension_v1.rb
|
|
298
|
+
- generated/stellar/ledger_header_extension_v1/ext.rb
|
|
299
|
+
- generated/stellar/ledger_header_flags.rb
|
|
280
300
|
- generated/stellar/ledger_header_history_entry.rb
|
|
281
301
|
- generated/stellar/ledger_header_history_entry/ext.rb
|
|
282
302
|
- generated/stellar/ledger_key.rb
|
|
283
303
|
- generated/stellar/ledger_key/account.rb
|
|
284
304
|
- generated/stellar/ledger_key/claimable_balance.rb
|
|
285
305
|
- generated/stellar/ledger_key/data.rb
|
|
306
|
+
- generated/stellar/ledger_key/liquidity_pool.rb
|
|
286
307
|
- generated/stellar/ledger_key/offer.rb
|
|
287
308
|
- generated/stellar/ledger_key/trust_line.rb
|
|
288
309
|
- generated/stellar/ledger_scp_messages.rb
|
|
289
310
|
- generated/stellar/ledger_upgrade.rb
|
|
290
311
|
- generated/stellar/ledger_upgrade_type.rb
|
|
291
312
|
- generated/stellar/liabilities.rb
|
|
313
|
+
- generated/stellar/liquidity_pool_constant_product_parameters.rb
|
|
314
|
+
- generated/stellar/liquidity_pool_deposit_op.rb
|
|
315
|
+
- generated/stellar/liquidity_pool_deposit_result.rb
|
|
316
|
+
- generated/stellar/liquidity_pool_deposit_result_code.rb
|
|
317
|
+
- generated/stellar/liquidity_pool_entry.rb
|
|
318
|
+
- generated/stellar/liquidity_pool_entry/body.rb
|
|
319
|
+
- generated/stellar/liquidity_pool_entry/body/constant_product.rb
|
|
320
|
+
- generated/stellar/liquidity_pool_parameters.rb
|
|
321
|
+
- generated/stellar/liquidity_pool_type.rb
|
|
322
|
+
- generated/stellar/liquidity_pool_withdraw_op.rb
|
|
323
|
+
- generated/stellar/liquidity_pool_withdraw_result.rb
|
|
324
|
+
- generated/stellar/liquidity_pool_withdraw_result_code.rb
|
|
292
325
|
- generated/stellar/manage_buy_offer_op.rb
|
|
293
326
|
- generated/stellar/manage_buy_offer_result.rb
|
|
294
327
|
- generated/stellar/manage_buy_offer_result_code.rb
|
|
@@ -311,8 +344,6 @@ files:
|
|
|
311
344
|
- generated/stellar/offer_entry_flags.rb
|
|
312
345
|
- generated/stellar/operation.rb
|
|
313
346
|
- generated/stellar/operation/body.rb
|
|
314
|
-
- generated/stellar/operation_id.rb
|
|
315
|
-
- generated/stellar/operation_id/id.rb
|
|
316
347
|
- generated/stellar/operation_meta.rb
|
|
317
348
|
- generated/stellar/operation_result.rb
|
|
318
349
|
- generated/stellar/operation_result/tr.rb
|
|
@@ -355,6 +386,9 @@ files:
|
|
|
355
386
|
- generated/stellar/set_options_op.rb
|
|
356
387
|
- generated/stellar/set_options_result.rb
|
|
357
388
|
- generated/stellar/set_options_result_code.rb
|
|
389
|
+
- generated/stellar/set_trust_line_flags_op.rb
|
|
390
|
+
- generated/stellar/set_trust_line_flags_result.rb
|
|
391
|
+
- generated/stellar/set_trust_line_flags_result_code.rb
|
|
358
392
|
- generated/stellar/signed_survey_request_message.rb
|
|
359
393
|
- generated/stellar/signed_survey_response_message.rb
|
|
360
394
|
- generated/stellar/signer.rb
|
|
@@ -396,17 +430,21 @@ files:
|
|
|
396
430
|
- generated/stellar/transaction_v0/ext.rb
|
|
397
431
|
- generated/stellar/transaction_v0_envelope.rb
|
|
398
432
|
- generated/stellar/transaction_v1_envelope.rb
|
|
433
|
+
- generated/stellar/trust_line_asset.rb
|
|
399
434
|
- generated/stellar/trust_line_entry.rb
|
|
400
435
|
- generated/stellar/trust_line_entry/ext.rb
|
|
401
436
|
- generated/stellar/trust_line_entry/ext/v1.rb
|
|
402
437
|
- generated/stellar/trust_line_entry/ext/v1/ext.rb
|
|
438
|
+
- generated/stellar/trust_line_entry_extension_v2.rb
|
|
439
|
+
- generated/stellar/trust_line_entry_extension_v2/ext.rb
|
|
403
440
|
- generated/stellar/trust_line_flags.rb
|
|
404
441
|
- generated/stellar/upgrade_entry_meta.rb
|
|
405
442
|
- lib/stellar-base.rb
|
|
443
|
+
- lib/stellar/account.rb
|
|
406
444
|
- lib/stellar/account_flags.rb
|
|
445
|
+
- lib/stellar/amount.rb
|
|
407
446
|
- lib/stellar/asset.rb
|
|
408
447
|
- lib/stellar/base.rb
|
|
409
|
-
- lib/stellar/base/version.rb
|
|
410
448
|
- lib/stellar/claim_predicate.rb
|
|
411
449
|
- lib/stellar/compat.rb
|
|
412
450
|
- lib/stellar/concerns/transaction.rb
|
|
@@ -417,6 +455,9 @@ files:
|
|
|
417
455
|
- lib/stellar/fee_bump_transaction.rb
|
|
418
456
|
- lib/stellar/key_pair.rb
|
|
419
457
|
- lib/stellar/ledger_key.rb
|
|
458
|
+
- lib/stellar/liquidity_pool.rb
|
|
459
|
+
- lib/stellar/liquidity_pool/base_pool.rb
|
|
460
|
+
- lib/stellar/liquidity_pool/constant_product_pool.rb
|
|
420
461
|
- lib/stellar/muxed_account.rb
|
|
421
462
|
- lib/stellar/networks.rb
|
|
422
463
|
- lib/stellar/operation.rb
|
|
@@ -428,15 +469,19 @@ files:
|
|
|
428
469
|
- lib/stellar/transaction_builder.rb
|
|
429
470
|
- lib/stellar/transaction_envelope.rb
|
|
430
471
|
- lib/stellar/transaction_v0.rb
|
|
472
|
+
- lib/stellar/trust_line_flags.rb
|
|
431
473
|
- lib/stellar/util/strkey.rb
|
|
432
|
-
|
|
474
|
+
- lib/stellar/version.rb
|
|
475
|
+
homepage: https://github.com/astroband/ruby-stellar-sdk
|
|
433
476
|
licenses:
|
|
434
477
|
- Apache-2.0
|
|
435
478
|
metadata:
|
|
479
|
+
bug_tracker_uri: https://github.com/astroband/ruby-stellar-sdk/issues
|
|
480
|
+
changelog_uri: https://github.com/astroband/ruby-stellar-sdk/blob/v0.30.0/base/CHANGELOG.md
|
|
481
|
+
documentation_uri: https://rubydoc.info/gems/stellar-base/0.30.0/
|
|
436
482
|
github_repo: ssh://github.com/astroband/ruby-stellar-sdk
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.26.0/base
|
|
483
|
+
homepage_uri: https://github.com/astroband/ruby-stellar-sdk/tree/main/base
|
|
484
|
+
source_code_uri: https://github.com/astroband/ruby-stellar-sdk/tree/v0.30.0/base
|
|
440
485
|
post_install_message:
|
|
441
486
|
rdoc_options: []
|
|
442
487
|
require_paths:
|
|
@@ -453,7 +498,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
453
498
|
- !ruby/object:Gem::Version
|
|
454
499
|
version: '0'
|
|
455
500
|
requirements: []
|
|
456
|
-
rubygems_version: 3.2.
|
|
501
|
+
rubygems_version: 3.2.22
|
|
457
502
|
signing_key:
|
|
458
503
|
specification_version: 4
|
|
459
504
|
summary: 'Stellar client library: XDR'
|
|
@@ -1,33 +0,0 @@
|
|
|
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 (AssetType type)
|
|
9
|
-
# {
|
|
10
|
-
# // ASSET_TYPE_NATIVE is not allowed
|
|
11
|
-
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
|
12
|
-
# AssetCode4 assetCode4;
|
|
13
|
-
#
|
|
14
|
-
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
|
15
|
-
# AssetCode12 assetCode12;
|
|
16
|
-
#
|
|
17
|
-
# // add other asset types here in the future
|
|
18
|
-
# }
|
|
19
|
-
#
|
|
20
|
-
# ===========================================================================
|
|
21
|
-
module Stellar
|
|
22
|
-
class AllowTrustOp
|
|
23
|
-
class Asset < XDR::Union
|
|
24
|
-
switch_on AssetType, :type
|
|
25
|
-
|
|
26
|
-
switch :asset_type_credit_alphanum4, :asset_code4
|
|
27
|
-
switch :asset_type_credit_alphanum12, :asset_code12
|
|
28
|
-
|
|
29
|
-
attribute :asset_code4, AssetCode4
|
|
30
|
-
attribute :asset_code12, AssetCode12
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|