Class: Privy::Models::SwapQuoteRequestBody

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/privy/models/swap_quote_request_body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(base_amount:, destination:, source:, amount_type: nil, slippage_bps: nil) ⇒ Object

Some parameter documentations has been truncated, see Privy::Models::SwapQuoteRequestBody for more details.

Input for requesting a token swap quote.

Parameters:

  • base_amount (String)

    Amount in base units (e.g., wei for ETH). Must be a non-negative integer string.

  • destination (Privy::Models::SwapQuoteDestination)

    The output side of a swap quote request.

  • source (Privy::Models::SwapSource)

    The input side of a swap request, including token and chain.

  • amount_type (Symbol, Privy::Models::AmountType) (defaults to: nil)

    Whether the amount refers to the input token or output token.

  • slippage_bps (Float) (defaults to: nil)

    Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto



# File 'lib/privy/models/swap_quote_request_body.rb', line 37

Instance Attribute Details

#amount_typeSymbol, ...

Whether the amount refers to the input token or output token.

Returns:



28
# File 'lib/privy/models/swap_quote_request_body.rb', line 28

optional :amount_type, enum: -> { Privy::AmountType }

#base_amountString

Amount in base units (e.g., wei for ETH). Must be a non-negative integer string.

Returns:

  • (String)


10
# File 'lib/privy/models/swap_quote_request_body.rb', line 10

required :base_amount, String

#destinationPrivy::Models::SwapQuoteDestination

The output side of a swap quote request.



16
# File 'lib/privy/models/swap_quote_request_body.rb', line 16

required :destination, -> { Privy::SwapQuoteDestination }

#slippage_bpsFloat?

Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto-slippage is used.

Returns:

  • (Float, nil)


35
# File 'lib/privy/models/swap_quote_request_body.rb', line 35

optional :slippage_bps, Float

#sourcePrivy::Models::SwapSource

The input side of a swap request, including token and chain.



22
# File 'lib/privy/models/swap_quote_request_body.rb', line 22

required :source, -> { Privy::SwapSource }