Class: WhopSDK::Models::SwapCreateQuoteParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/whop_sdk/models/swap_create_quote_params.rb,
sig/whop_sdk/models/swap_create_quote_params.rbs

Overview

See Also:

  • WhopSDK::Resources::Swaps#create_quote

Defined Under Namespace

Modules: FromChain, ToChain

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(amount:, from_token:, to_token:, from_address: nil, from_chain: nil, metadata: nil, slippage_bps: nil, to_address: nil, to_chain: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::SwapCreateQuoteParams for more details.

Parameters:

  • amount (String)

    Source token amount.

  • from_token (String)

    Source token contract address or ticker symbol, such as "USDT".

  • to_token (String)

    Destination token contract address or ticker symbol, such as "XAUT".

  • from_address (String, nil) (defaults to: nil)

    Source wallet address used for the quote.

  • from_chain (String, Integer, nil) (defaults to: nil)

    Source chain name or chain ID. Defaults to the source token's chain when omitted

  • metadata (Hash{Symbol=>Object}) (defaults to: nil)

    Metadata to include with the quote response.

  • slippage_bps (Integer, nil) (defaults to: nil)

    Maximum slippage tolerance in basis points.

  • to_address (String, nil) (defaults to: nil)

    Destination wallet address used for the quote.

  • to_chain (String, Integer, nil) (defaults to: nil)

    Destination chain name or chain ID. Defaults to the destination token's chain wh

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 66

Instance Attribute Details

#amountString

Source token amount.

Parameters:

  • value (String)

Returns:

  • (String)


14
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 14

required :amount, String

#from_addressString?

Source wallet address used for the quote.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


32
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 32

optional :from_address, String, nil?: true

#from_chainString, ...

Source chain name or chain ID. Defaults to the source token's chain when omitted.

Parameters:

  • value (WhopSDK::Models::SwapCreateQuoteParams::from_chain, nil)

Returns:

  • (String, Integer, nil)


39
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 39

optional :from_chain, union: -> { WhopSDK::SwapCreateQuoteParams::FromChain }, nil?: true

#from_tokenString

Source token contract address or ticker symbol, such as "USDT".

Parameters:

  • value (String)

Returns:

  • (String)


20
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 20

required :from_token, String

#metadataHash{Symbol=>Object}?

Metadata to include with the quote response.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


45
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 45

optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]

#slippage_bpsInteger?

Maximum slippage tolerance in basis points.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


51
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 51

optional :slippage_bps, Integer, nil?: true

#to_addressString?

Destination wallet address used for the quote.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


57
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 57

optional :to_address, String, nil?: true

#to_chainString, ...

Destination chain name or chain ID. Defaults to the destination token's chain when omitted.

Parameters:

  • value (WhopSDK::Models::SwapCreateQuoteParams::to_chain, nil)

Returns:

  • (String, Integer, nil)


64
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 64

optional :to_chain, union: -> { WhopSDK::SwapCreateQuoteParams::ToChain }, nil?: true

#to_tokenString

Destination token contract address or ticker symbol, such as "XAUT".

Parameters:

  • value (String)

Returns:

  • (String)


26
# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 26

required :to_token, String

Class Method Details

.variantsArray(String, Integer)

Returns:

  • (Array(String, Integer))


# File 'lib/whop_sdk/models/swap_create_quote_params.rb', line 99

Instance Method Details

#to_hash{

Returns:

  • ({)


54
# File 'sig/whop_sdk/models/swap_create_quote_params.rbs', line 54

def to_hash: -> {