Class: WhopSDK::Models::SwapCreateResponse

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

Overview

See Also:

  • WhopSDK::Resources::Swaps#create

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(id:, account_id:, object:, status:, amount_out_expected: nil, amount_out_min: nil, rate: nil, to_chain: nil) ⇒ Object

Parameters:

  • id (String)

    Swap ID. Poll GET /swaps/:id for status.

  • account_id (String)

    Account ID that owns the wallet used for the swap.

  • object (Symbol, WhopSDK::Models::SwapCreateResponse::Object)
  • status (String)

    Initial swap status.

  • amount_out_expected (String) (defaults to: nil)

    Expected destination token amount.

  • amount_out_min (String) (defaults to: nil)

    Minimum destination amount after slippage.

  • rate (String) (defaults to: nil)

    Quoted exchange rate used to create the swap.

  • to_chain (String) (defaults to: nil)

    Destination chain for the swap.



# File 'lib/whop_sdk/models/swap_create_response.rb', line 54

Instance Attribute Details

#account_idString

Account ID that owns the wallet used for the swap.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :account_id, String

#amount_out_expectedString?

Expected destination token amount.

Parameters:

  • (String)

Returns:

  • (String, nil)


34
# File 'lib/whop_sdk/models/swap_create_response.rb', line 34

optional :amount_out_expected, String

#amount_out_minString?

Minimum destination amount after slippage.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :amount_out_min, String

#idString

Swap ID. Poll GET /swaps/:id for status.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#objectSymbol, WhopSDK::Models::SwapCreateResponse::Object

Parameters:

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

Returns:



22
# File 'lib/whop_sdk/models/swap_create_response.rb', line 22

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

#rateString?

Quoted exchange rate used to create the swap.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :rate, String

#statusString

Initial swap status.

Parameters:

  • value (String)

Returns:

  • (String)


28
# File 'lib/whop_sdk/models/swap_create_response.rb', line 28

required :status, String

#to_chainString?

Destination chain for the swap.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :to_chain, String

Instance Method Details

#to_hash{

Returns:

  • ({)


51
# File 'sig/whop_sdk/models/swap_create_response.rbs', line 51

def to_hash: -> {