Class: WhopSDK::Models::SwapCreateQuoteResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/swap_create_quote_response.rb,
sig/whop_sdk/models/swap_create_quote_response.rbs

Overview

See Also:

  • WhopSDK::Resources::Swaps#create_quote

Defined Under Namespace

Modules: Object

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(amount_in:, amount_out:, fee_bps:, from_token:, metadata:, object:, rate:, to_token:, amount_out_min: nil, bridge_fee: nil, estimated_duration_seconds: nil, from_address: nil, requires_token_approval: nil, to_address: nil) ⇒ Object

Parameters:

  • amount_in (String)

    Source token amount used for the quote.

  • amount_out (String)

    Estimated destination token amount.

  • fee_bps (Integer)

    Whop fee in basis points.

  • from_token (Hash{Symbol=>Object})

    Resolved source token details.

  • metadata (Hash{Symbol=>Object})

    Metadata from the request.

  • object (Symbol, WhopSDK::Models::SwapCreateQuoteResponse::Object)
  • rate (String)

    Quoted exchange rate.

  • to_token (Hash{Symbol=>Object})

    Resolved destination token details.

  • amount_out_min (String) (defaults to: nil)

    Minimum destination amount after slippage.

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

    Estimated bridge fee for cross-chain swaps.

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

    Estimated time for the swap to complete.

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

    Source wallet address used for the quote.

  • requires_token_approval (Boolean, nil) (defaults to: nil)

    Whether the source token needs approval before swapping.

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

    Destination wallet address used for the quote.



# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 90

Instance Attribute Details

#amount_inString

Source token amount used for the quote.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 11

required :amount_in, String

#amount_outString

Estimated destination token amount.

Parameters:

  • value (String)

Returns:

  • (String)


17
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 17

required :amount_out, String

#amount_out_minString?

Minimum destination amount after slippage.

Parameters:

  • (String)

Returns:

  • (String, nil)


58
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 58

optional :amount_out_min, String

#bridge_feeString?

Estimated bridge fee for cross-chain swaps.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :bridge_fee, String, nil?: true

#estimated_duration_secondsInteger?

Estimated time for the swap to complete.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


70
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 70

optional :estimated_duration_seconds, Integer, nil?: true

#fee_bpsInteger

Whop fee in basis points.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


23
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 23

required :fee_bps, Integer

#from_addressString?

Source wallet address used for the quote.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


76
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 76

optional :from_address, String, nil?: true

#from_tokenHash{Symbol=>Object}

Resolved source token details.

Parameters:

  • value (::Hash[Symbol, top])

Returns:



29
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 29

required :from_token, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]

#metadataHash{Symbol=>Object}

Metadata from the request.

Parameters:

  • value (::Hash[Symbol, top])

Returns:



35
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 35

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

#objectSymbol, WhopSDK::Models::SwapCreateQuoteResponse::Object

Parameters:

  • value (WhopSDK::Models::SwapCreateQuoteResponse::object)

Returns:



40
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 40

required :object, enum: -> { WhopSDK::Models::SwapCreateQuoteResponse::Object }

#rateString

Quoted exchange rate.

Parameters:

  • value (String)

Returns:

  • (String)


46
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 46

required :rate, String

#requires_token_approvalBoolean?

Whether the source token needs approval before swapping.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


82
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 82

optional :requires_token_approval, WhopSDK::Internal::Type::Boolean, nil?: true

#to_addressString?

Destination wallet address used for the quote.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


88
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 88

optional :to_address, String, nil?: true

#to_tokenHash{Symbol=>Object}

Resolved destination token details.

Parameters:

  • value (::Hash[Symbol, top])

Returns:



52
# File 'lib/whop_sdk/models/swap_create_quote_response.rb', line 52

required :to_token, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]

Instance Method Details

#to_hash{

Returns:

  • ({)


69
# File 'sig/whop_sdk/models/swap_create_quote_response.rbs', line 69

def to_hash: -> {