Class: WhopSDK::Models::SwapListResponse::Data

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

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:, tx_hashes:, error: nil) ⇒ Object

Parameters:

  • id (String)

    Swap ID.

  • account_id (String)

    Account ID that owns the wallet used for the swap.

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

    Current swap status.

  • tx_hashes (Array<String>)

    On-chain transaction hashes produced by the swap.

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

    Latest error returned for a failed swap.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/whop_sdk/models/swap_list_response.rb', line 16

class Data < WhopSDK::Internal::Type::BaseModel
  # @!attribute id
  #   Swap ID.
  #
  #   @return [String]
  required :id, String

  # @!attribute account_id
  #   Account ID that owns the wallet used for the swap.
  #
  #   @return [String]
  required :account_id, String

  # @!attribute object
  #
  #   @return [Symbol, WhopSDK::Models::SwapListResponse::Data::Object]
  required :object, enum: -> { WhopSDK::Models::SwapListResponse::Data::Object }

  # @!attribute status
  #   Current swap status.
  #
  #   @return [String]
  required :status, String

  # @!attribute tx_hashes
  #   On-chain transaction hashes produced by the swap.
  #
  #   @return [Array<String>]
  required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String]

  # @!attribute error
  #   Latest error returned for a failed swap.
  #
  #   @return [String, nil]
  optional :error, String, nil?: true

  # @!method initialize(id:, account_id:, object:, status:, tx_hashes:, error: nil)
  #   @param id [String] Swap ID.
  #
  #   @param account_id [String] Account ID that owns the wallet used for the swap.
  #
  #   @param object [Symbol, WhopSDK::Models::SwapListResponse::Data::Object]
  #
  #   @param status [String] Current swap status.
  #
  #   @param tx_hashes [Array<String>] On-chain transaction hashes produced by the swap.
  #
  #   @param error [String, nil] Latest error returned for a failed swap.

  # @see WhopSDK::Models::SwapListResponse::Data#object
  module Object
    extend WhopSDK::Internal::Type::Enum

    SWAP = :swap

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#account_idString

Account ID that owns the wallet used for the swap.

Parameters:

  • value (String)

Returns:

  • (String)


27
# File 'lib/whop_sdk/models/swap_list_response.rb', line 27

required :account_id, String

#errorString?

Latest error returned for a failed swap.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


50
# File 'lib/whop_sdk/models/swap_list_response.rb', line 50

optional :error, String, nil?: true

#idString

Swap ID.

Parameters:

  • value (String)

Returns:

  • (String)


21
# File 'lib/whop_sdk/models/swap_list_response.rb', line 21

required :id, String

#objectSymbol, WhopSDK::Models::SwapListResponse::Data::Object

Parameters:

  • value (WhopSDK::Models::SwapListResponse::Data::object)

Returns:



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

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

#statusString

Current swap status.

Parameters:

  • value (String)

Returns:

  • (String)


38
# File 'lib/whop_sdk/models/swap_list_response.rb', line 38

required :status, String

#tx_hashesArray<String>

On-chain transaction hashes produced by the swap.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


44
# File 'lib/whop_sdk/models/swap_list_response.rb', line 44

required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String]

Instance Method Details

#to_hash{

Returns:

  • ({)


47
# File 'sig/whop_sdk/models/swap_list_response.rbs', line 47

def to_hash: -> {