stellar-base 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/generated/stellar/allow_trust_result_code.rb +4 -1
  4. data/generated/stellar/alpha_num12.rb +20 -0
  5. data/generated/stellar/alpha_num4.rb +20 -0
  6. data/generated/stellar/asset.rb +2 -15
  7. data/generated/stellar/asset_type.rb +3 -1
  8. data/generated/stellar/change_trust_asset.rb +39 -0
  9. data/generated/stellar/change_trust_op.rb +2 -2
  10. data/generated/stellar/change_trust_result_code.rb +13 -7
  11. data/generated/stellar/claim_atom.rb +31 -0
  12. data/generated/stellar/claim_atom_type.rb +24 -0
  13. data/generated/stellar/claim_liquidity_atom.rb +30 -0
  14. data/generated/stellar/claim_offer_atom_v0.rb +33 -0
  15. data/generated/stellar/envelope_type.rb +10 -8
  16. data/generated/stellar/{operation_id/id.rb → hash_id_preimage/operation_id.rb} +2 -2
  17. data/generated/stellar/{operation_id.rb → hash_id_preimage/revoke_id.rb} +12 -16
  18. data/generated/stellar/hash_id_preimage.rb +44 -0
  19. data/generated/stellar/ledger_entry/data.rb +4 -0
  20. data/generated/stellar/ledger_entry.rb +2 -0
  21. data/generated/stellar/ledger_entry_type.rb +3 -1
  22. data/generated/stellar/ledger_header/ext.rb +4 -0
  23. data/generated/stellar/ledger_header.rb +2 -0
  24. data/generated/stellar/{asset/alpha_num12.rb → ledger_header_extension_v1/ext.rb} +9 -7
  25. data/generated/stellar/ledger_header_extension_v1.rb +30 -0
  26. data/generated/stellar/ledger_header_flags.rb +24 -0
  27. data/generated/stellar/{asset/alpha_num4.rb → ledger_key/liquidity_pool.rb} +4 -6
  28. data/generated/stellar/ledger_key/trust_line.rb +2 -2
  29. data/generated/stellar/ledger_key.rb +10 -1
  30. data/generated/stellar/ledger_upgrade.rb +4 -0
  31. data/generated/stellar/ledger_upgrade_type.rb +3 -1
  32. data/generated/stellar/liquidity_pool_constant_product_parameters.rb +22 -0
  33. data/generated/stellar/liquidity_pool_deposit_op.rb +26 -0
  34. data/generated/stellar/liquidity_pool_deposit_result.rb +26 -0
  35. data/generated/stellar/liquidity_pool_deposit_result_code.rb +41 -0
  36. data/generated/stellar/liquidity_pool_entry/body/constant_product.rb +31 -0
  37. data/generated/stellar/liquidity_pool_entry/body.rb +37 -0
  38. data/generated/stellar/liquidity_pool_entry.rb +38 -0
  39. data/generated/stellar/liquidity_pool_parameters.rb +23 -0
  40. data/generated/stellar/liquidity_pool_type.rb +20 -0
  41. data/generated/stellar/liquidity_pool_withdraw_op.rb +24 -0
  42. data/generated/stellar/liquidity_pool_withdraw_result.rb +26 -0
  43. data/generated/stellar/liquidity_pool_withdraw_result_code.rb +36 -0
  44. data/generated/stellar/manage_offer_success_result.rb +2 -2
  45. data/generated/stellar/operation/body.rb +8 -0
  46. data/generated/stellar/operation.rb +4 -0
  47. data/generated/stellar/operation_result/tr.rb +8 -0
  48. data/generated/stellar/operation_result.rb +4 -0
  49. data/generated/stellar/operation_type.rb +5 -1
  50. data/generated/stellar/path_payment_strict_receive_result/success.rb +2 -2
  51. data/generated/stellar/path_payment_strict_receive_result.rb +1 -1
  52. data/generated/stellar/path_payment_strict_send_result/success.rb +2 -2
  53. data/generated/stellar/path_payment_strict_send_result.rb +1 -1
  54. data/generated/stellar/revoke_sponsorship_result_code.rb +3 -1
  55. data/generated/stellar/scp_quorum_set.rb +2 -2
  56. data/generated/stellar/set_trust_line_flags_result_code.rb +4 -1
  57. data/generated/stellar/trust_line_asset.rb +39 -0
  58. data/generated/stellar/trust_line_entry/ext/v1/ext.rb +4 -0
  59. data/generated/stellar/trust_line_entry/ext/v1.rb +2 -0
  60. data/generated/stellar/trust_line_entry/ext.rb +2 -0
  61. data/generated/stellar/trust_line_entry.rb +7 -5
  62. data/generated/stellar/trust_line_entry_extension_v2/ext.rb +24 -0
  63. data/generated/stellar/trust_line_entry_extension_v2.rb +30 -0
  64. data/generated/stellar-base-generated.rb +25 -1
  65. data/lib/stellar/account_flags.rb +1 -1
  66. data/lib/stellar/amount.rb +36 -0
  67. data/lib/stellar/asset.rb +8 -0
  68. data/lib/stellar/dsl.rb +3 -0
  69. data/lib/stellar/ledger_key.rb +5 -3
  70. data/lib/stellar/liquidity_pool/base_pool.rb +47 -0
  71. data/lib/stellar/liquidity_pool/constant_product_pool.rb +15 -0
  72. data/lib/stellar/liquidity_pool.rb +12 -0
  73. data/lib/stellar/operation.rb +346 -444
  74. data/lib/stellar/price.rb +13 -7
  75. data/lib/stellar/transaction_builder.rb +8 -5
  76. data/lib/stellar/version.rb +1 -1
  77. data/lib/stellar-base.rb +2 -0
  78. metadata +39 -10
@@ -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
- # PublicKey validators<>;
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[PublicKey]
19
+ attribute :validators, XDR::VarArray[NodeID]
20
20
  attribute :inner_sets, XDR::VarArray[SCPQuorumSet]
21
21
  end
22
22
  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,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
@@ -13,6 +13,8 @@ require 'xdr'
13
13
  # {
14
14
  # case 0:
15
15
  # void;
16
+ # case 2:
17
+ # TrustLineEntryExtensionV2 v2;
16
18
  # }
17
19
  # ext;
18
20
  # }
@@ -18,6 +18,8 @@ require 'xdr'
18
18
  # {
19
19
  # case 0:
20
20
  # void;
21
+ # case 2:
22
+ # TrustLineEntryExtensionV2 v2;
21
23
  # }
22
24
  # ext;
23
25
  # } v1;
@@ -7,10 +7,10 @@ require 'xdr'
7
7
  #
8
8
  # struct TrustLineEntry
9
9
  # {
10
- # AccountID accountID; // account this trustline belongs to
11
- # Asset asset; // type of asset (with issuer)
12
- # int64 balance; // how much of this asset the user has.
13
- # // Asset defines the unit for this;
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, Asset
49
+ attribute :asset, TrustLineAsset
48
50
  attribute :balance, Int64
49
51
  attribute :limit, Int64
50
52
  attribute :flags, Uint32
@@ -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 TrustLineEntryExtensionV2
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,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
+ # struct TrustLineEntryExtensionV2
9
+ # {
10
+ # int32 liquidityPoolUseCount;
11
+ #
12
+ # union switch (int v)
13
+ # {
14
+ # case 0:
15
+ # void;
16
+ # }
17
+ # ext;
18
+ # };
19
+ #
20
+ # ===========================================================================
21
+ module Stellar
22
+ class TrustLineEntryExtensionV2 < XDR::Struct
23
+ include XDR::Namespace
24
+
25
+ autoload :Ext
26
+
27
+ attribute :liquidity_pool_use_count, Int32
28
+ attribute :ext, Ext
29
+ end
30
+ end
@@ -35,10 +35,13 @@ module Stellar
35
35
  SequenceNumber = Int64
36
36
  TimePoint = Uint64
37
37
  DataValue = XDR::VarOpaque[64]
38
+ PoolID = Hash
38
39
  AssetCode4 = XDR::Opaque[4]
39
40
  AssetCode12 = XDR::Opaque[12]
40
41
  autoload :AssetType
41
42
  autoload :AssetCode
43
+ autoload :AlphaNum4
44
+ autoload :AlphaNum12
42
45
  autoload :Asset
43
46
  autoload :Price
44
47
  autoload :Liabilities
@@ -57,6 +60,9 @@ module Stellar
57
60
  MASK_TRUSTLINE_FLAGS = 1
58
61
  MASK_TRUSTLINE_FLAGS_V13 = 3
59
62
  MASK_TRUSTLINE_FLAGS_V17 = 7
63
+ autoload :LiquidityPoolType
64
+ autoload :TrustLineAsset
65
+ autoload :TrustLineEntryExtensionV2
60
66
  autoload :TrustLineEntry
61
67
  autoload :OfferEntryFlags
62
68
  MASK_OFFERENTRY_FLAGS = 1
@@ -72,6 +78,8 @@ module Stellar
72
78
  MASK_CLAIMABLE_BALANCE_FLAGS = 0x1
73
79
  autoload :ClaimableBalanceEntryExtensionV1
74
80
  autoload :ClaimableBalanceEntry
81
+ autoload :LiquidityPoolConstantProductParameters
82
+ autoload :LiquidityPoolEntry
75
83
  autoload :LedgerEntryExtensionV1
76
84
  autoload :LedgerEntry
77
85
  autoload :LedgerKey
@@ -80,6 +88,7 @@ end
80
88
  module Stellar
81
89
  include XDR::Namespace
82
90
 
91
+ autoload :LiquidityPoolParameters
83
92
  autoload :MuxedAccount
84
93
  autoload :DecoratedSignature
85
94
  autoload :OperationType
@@ -91,6 +100,7 @@ module Stellar
91
100
  autoload :ManageBuyOfferOp
92
101
  autoload :CreatePassiveSellOfferOp
93
102
  autoload :SetOptionsOp
103
+ autoload :ChangeTrustAsset
94
104
  autoload :ChangeTrustOp
95
105
  autoload :AllowTrustOp
96
106
  autoload :ManageDataOp
@@ -103,8 +113,11 @@ module Stellar
103
113
  autoload :ClawbackOp
104
114
  autoload :ClawbackClaimableBalanceOp
105
115
  autoload :SetTrustLineFlagsOp
116
+ LIQUIDITY_POOL_FEE_V18 = 30
117
+ autoload :LiquidityPoolDepositOp
118
+ autoload :LiquidityPoolWithdrawOp
106
119
  autoload :Operation
107
- autoload :OperationID
120
+ autoload :HashIDPreimage
108
121
  autoload :MemoType
109
122
  autoload :Memo
110
123
  autoload :TimeBounds
@@ -117,7 +130,11 @@ module Stellar
117
130
  autoload :FeeBumpTransactionEnvelope
118
131
  autoload :TransactionEnvelope
119
132
  autoload :TransactionSignaturePayload
133
+ autoload :ClaimAtomType
134
+ autoload :ClaimOfferAtomV0
120
135
  autoload :ClaimOfferAtom
136
+ autoload :ClaimLiquidityAtom
137
+ autoload :ClaimAtom
121
138
  autoload :CreateAccountResultCode
122
139
  autoload :CreateAccountResult
123
140
  autoload :PaymentResultCode
@@ -164,6 +181,10 @@ module Stellar
164
181
  autoload :ClawbackClaimableBalanceResult
165
182
  autoload :SetTrustLineFlagsResultCode
166
183
  autoload :SetTrustLineFlagsResult
184
+ autoload :LiquidityPoolDepositResultCode
185
+ autoload :LiquidityPoolDepositResult
186
+ autoload :LiquidityPoolWithdrawResultCode
187
+ autoload :LiquidityPoolWithdrawResult
167
188
  autoload :OperationResultCode
168
189
  autoload :OperationResult
169
190
  autoload :TransactionResultCode
@@ -178,6 +199,9 @@ module Stellar
178
199
  autoload :StellarValueType
179
200
  autoload :LedgerCloseValueSignature
180
201
  autoload :StellarValue
202
+ MASK_LEDGER_HEADER_FLAGS = 0x7
203
+ autoload :LedgerHeaderFlags
204
+ autoload :LedgerHeaderExtensionV1
181
205
  autoload :LedgerHeader
182
206
  autoload :LedgerUpgradeType
183
207
  autoload :LedgerUpgrade
@@ -4,7 +4,7 @@ module Stellar
4
4
  # Converts an array of Stellar::AccountFlags members into
5
5
  # an Integer suitable for use in a SetOptionsOp.
6
6
  #
7
- # @param flags [Array<Stellar::AccountFlags>] the flags to combine
7
+ # @param flags [Array<Stellar::AccountFlags>, nil] the flags to combine
8
8
  #
9
9
  # @return [Fixnum] the combined result
10
10
  def self.make_mask(flags = nil)
@@ -0,0 +1,36 @@
1
+ module Stellar
2
+ class Amount
3
+ attr_reader :amount
4
+ attr_reader :asset
5
+
6
+ # @param [Fixnum] amount
7
+ # @param [Stellar::Asset] asset
8
+ def initialize(amount, asset = Stellar::Asset.native)
9
+ # TODO: how are we going to handle decimal considerations?
10
+
11
+ @amount = amount
12
+ @asset = asset
13
+ end
14
+
15
+ # @return [Array(Symbol, Fixnum)] in case of a native asset
16
+ # @return [Array(Symbol, String, Stellar::KeyPair, Fixnum)] in case of alphanum asset
17
+ def to_payment
18
+ case asset.type
19
+ when AssetType.asset_type_native
20
+ [:native, amount]
21
+ when AssetType.asset_type_credit_alphanum4
22
+ keypair = KeyPair.from_public_key(asset.issuer.value)
23
+ [:alphanum4, asset.code, keypair, amount]
24
+ when AssetType.asset_type_credit_alphanum12
25
+ keypair = KeyPair.from_public_key(asset.issuer.value)
26
+ [:alphanum12, asset.code, keypair, amount]
27
+ else
28
+ raise "Unknown asset type: #{asset.type}"
29
+ end
30
+ end
31
+
32
+ def inspect
33
+ "#<Stellar::Amount #{asset}(#{amount})>"
34
+ end
35
+ end
36
+ end
data/lib/stellar/asset.rb CHANGED
@@ -30,6 +30,14 @@ module Stellar
30
30
  new(:asset_type_credit_alphanum12, an)
31
31
  end
32
32
 
33
+ def to_change_trust_asset
34
+ ChangeTrustAsset.new(switch, value)
35
+ end
36
+
37
+ def to_trust_line_asset
38
+ TrustLineAsset.new(switch, value)
39
+ end
40
+
33
41
  def to_s
34
42
  case switch
35
43
  when AssetType.asset_type_native
data/lib/stellar/dsl.rb CHANGED
@@ -53,6 +53,9 @@ module Stellar
53
53
  case subject
54
54
  when Asset
55
55
  subject
56
+ when Array
57
+ raise TypeError, "Invalid asset type #{subject[0]}" unless [:native, :alphanum4, :alphanum12].include?(subject[0])
58
+ Asset.send(*subject)
56
59
  when nil, /^(XLM[-:])?native$/
57
60
  Asset.native
58
61
  when /^([0-9A-Z]{1,4})[-:](G[A-Z0-9]{55})$/
@@ -15,14 +15,16 @@ module Stellar
15
15
  case field
16
16
  when nil
17
17
  account(account_id: KeyPair(account_id).account_id)
18
- when :balance_id
19
- claimable_balance(balance_id: ClaimableBalanceID.v0(Stellar::Convert.from_hex(value.to_s)))
20
18
  when :offer_id
21
19
  offer(seller_id: account_id, offer_id: Integer(value))
22
20
  when :data_name
23
21
  data(account_id: account_id, data_name: value.to_s)
24
22
  when :asset
25
- trust_line(account_id: account_id, asset: Asset(value))
23
+ trust_line(account_id: account_id, asset: Asset(value).to_trust_line_asset)
24
+ when :balance_id
25
+ claimable_balance(balance_id: ClaimableBalanceID.v0(Stellar::Convert.from_hex(value.to_s)))
26
+ when :liquidity_pool_id
27
+ liquidity_pool(liquidity_pool_id: PoolID.from_xdr(value.to_s, :hex))
26
28
  else
27
29
  raise ArgumentError, "unknown option #{field} (not in :asset, :offer_id, :data_name, :balance_id)"
28
30
  end
@@ -0,0 +1,47 @@
1
+ module Stellar
2
+ module LiquidityPool
3
+ class BasePool
4
+ attr_reader :asset_a, :asset_b, :fee
5
+
6
+ # @param asset_a [Asset]
7
+ # @param asset_b [Asset]
8
+ def initialize(asset_a:, asset_b:)
9
+ @asset_a = asset_a
10
+ @asset_b = asset_b
11
+ @fee = LIQUIDITY_POOL_FEE_V18
12
+ end
13
+
14
+ def id
15
+ PoolID.to_xdr(to_pool_id, :hex)
16
+ end
17
+
18
+ def to_s
19
+ "liquidity_pool:#{id}"
20
+ end
21
+
22
+ def inspect
23
+ "#<#{self.class.name} #{self}>"
24
+ end
25
+
26
+ def to_pool_id
27
+ Digest::SHA256.digest(pool_params.to_xdr)
28
+ end
29
+
30
+ def to_change_trust_asset
31
+ ChangeTrustAsset.liquidity_pool(pool_params)
32
+ end
33
+
34
+ def to_trust_line_asset
35
+ TrustLineAsset.liquidity_pool_id(to_pool_id)
36
+ end
37
+
38
+ def pool_type
39
+ raise NotImplementedError
40
+ end
41
+
42
+ def pool_params
43
+ raise NotImplementedError
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,15 @@
1
+ require_relative "base_pool"
2
+
3
+ module Stellar
4
+ module LiquidityPool
5
+ class ConstantProductPool < BasePool
6
+ def pool_type
7
+ LiquidityPoolType.constant_product
8
+ end
9
+
10
+ def pool_params
11
+ LiquidityPoolParameters.constant_product(asset_a: asset_a, asset_b: asset_b, fee: fee)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Stellar
2
+ module LiquidityPool
3
+ require_relative "liquidity_pool/base_pool"
4
+ require_relative "liquidity_pool/constant_product_pool"
5
+
6
+ module_function
7
+
8
+ def constant_product(asset_a:, asset_b:)
9
+ ConstantProductPool.new(asset_a: DSL::Asset(asset_a), asset_b: DSL::Asset(asset_b))
10
+ end
11
+ end
12
+ end